2019年4月17日先贴一下原来的代码,是按照书上直接抄下来的 from urllib.robotparser import RobotFileParser from urllib.request import urlopen rp = RobotFileParser() rp.parse(urlopen('http://www.jianshu.com/robots.txt').read().decode('utf-8').split('\n')) print(rp.can_fetch('*', 'http://www.jiansh...