robots协议的作用:
Robots协议(也称为爬虫协议、机器人协议等)的全称是“网络爬虫排除标准”(Robots Exclusion Protocol),网站通过Robots协议告诉搜索引擎哪些页面可以抓取,哪些页面不能抓取。是网络资源提供者与搜索引擎之间的道德约定。
robot协议的位置:
robots.txt文件应该放在网站根目录下。举例来说,当robots访问一个网站(比如http://www.abc.com)时,首先会检查该网站中是否存在http://www.abc.com/robots.txt这个文件,如果机器人找到这个文件,它就会根据这个文件的内容,来确定它访问权限的范围。
解析亚马逊网站的robots协议:
1.浏览器地址栏输入:https://www.amazon.com/robots.txt,查看robots协议
User-agent: * ——表示所列规则对所有爬虫都适用
此外,亚马逊还对两个爬虫代理进行了特殊规定:
User-agent: Googlebot
User-agent: EtaoSpider
被User-agent指明的爬虫代理,还需遵守User-agent: agentName下所列规则。
2.查看User-agent: *下,Allow项
Allow: /wishlist/universal* #####表示允许爬虫代理访问,wishlist目录下,所有以universal开头的内容
Allow: /wishlist/vendor-button*
Allow: /wishlist/get-button*
Allow: /gp/wishlist/universal*
Allow: /gp/wishlist/vendor-button*
Allow: /gp/wishlist/ipad-install*
Allow: /gp/dmusic/promotions/PrimeMusic #####表示允许爬虫代理访问,PrimeMusic目录下的所有内容
Allow: /gp/dmusic/promotions/AmazonMusicUnlimited
Allow: /gp/offer-listing/B000
Allow: /gp/offer-listing/9000
3.查看Allow项对应的网页内容
1)wishlist:
2)PrimeMusic:

3)AmazonMusicUnlimited

网友评论