python爬虫--robots协议

robots exclusion standard 网络爬虫排除标准

基本概念

1.使用基本语法user-agentdisallow语法告知哪些内容可以爬取,爬虫时会自动或人工识别协议内容再进行内容爬取。
2.协议存放在网站根目录robots.txt中,无robots文件表示都可以爬虫访问。robots协议是建议性的,不遵守会存在法律风险。
3.爬取规模:request库(网页)<scrapy库(网站)<定制开发
4.eg:www.jd.com/robots.txt
www.baidu.com/robots.txtpython爬虫--robots协议