Robots协议
·告知所有爬虫网站的爬取策略,要求爬虫遵守
·是否遵守有爬虫自身来决定
·属于道德限制
- Robots协议
全称 Robots Exclusion Standard 网络爬虫排除标准
作用 网站告知所有爬虫那些页面可以抓取,那些不行
形式 在网站根目录下的robots.txt
例如:user-agent:* * 表示所有的爬虫 Disallow:/?* 表示不能访问以?开头的路径 Disallow:/pop/*.html 表示不能访问符合/pop/*.html的页面 Disallow:/pinpai/.html? 表示不能访问符合/pinpai/*.html?*的页面 user-agent:HuihuiSpider 表示HuihuiSpider爬虫 Disallow:/ 表示不允许爬取网站的任何资源 user-agent:GwdangSpider Disallow:/ user-agent:WochachSpider Disallow:/