首页 > 编程语言 > 详细

Python 爬虫-Robots协议

时间:2017-07-25 22:08:00      阅读:500      评论:0      收藏:0      [点我收藏+]

2017-07-25 21:08:16

一、网络爬虫的规模

技术分享

二、网络爬虫的限制

? 来源审查:判断User‐Agent进行限制
  检查来访HTTP协议头的User‐Agent域,只响应浏览器或友好爬虫的访问
? 发布公告:Robots协议
  告知所有爬虫网站的爬取策略,要求爬虫遵守

三、Robots 协议

作用:网站告知网络爬虫哪些页面可以抓取,哪些不行
形式:在网站根目录下的robots.txt文件

如果网站不提供Robots协议则表示该网站允许任意爬虫爬取任意次数。

类人类行为原则上可以不遵守Robots协议

https://www.baidu.com/robots.txt
http://news.sina.com.cn/robots.txt

 

举例:

https://www.jd.com/robots.txt

User‐agent: *
Disallow: /?*
Disallow: /pop/*.html
Disallow: /pinpai/*.html?*
User‐agent: EtaoSpider
Disallow: /
User‐agent: HuihuiSpider
Disallow: /
User‐agent: GwdangSpider
Disallow: /
User‐agent: WochachaSpider
Disallow: /

# 注释,*代表所有,/代表根目录
User‐agent: *
Disallow: /

 

Python 爬虫-Robots协议

原文:http://www.cnblogs.com/TIMHY/p/7236670.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!