爬虫系列8解析robots.txt

来源:互联网 发布:知牛财经房间骗局 编辑:程序博客网 时间:2024/04/30 14:10
import robotparser rp = robotparser.RobotFileParser() rp.set_url('url/robot.txt') rp.read()user_agent = 'Spider' rp.can_fetch(user_agent, url)Boolean变量可以检测代理是否可以爬取
原创粉丝点击