码迷,mamicode.com
首页 > 其他好文 > 详细

爬虫基础 - Robots协议

时间:2019-01-21 21:07:24      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:over   爬虫基础   color   user   sea   col   bsp   爬虫   引擎   

Robots协议

指定一个robots.txt文件,告诉爬虫引擎怎么爬取

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

User-agent:  Baiduspider
Allow:  /article
Allow:  /oshtml
Allow:  /ershou
Allow: /$
Disallow:  /product/
Disallow:  /

User-Agent:  Googlebot
Allow:  /article
Allow:  /oshtml
Allow:  /product
Allow:  /spu
Allow:  /dianpu
Allow:  /oversea
Allow:  /list
Allow:  /ershou
Allow: /$
Disallow:  /

User-agent:  Bingbot
Allow:  /article
Allow:  /oshtml
Allow:  /product
Allow:  /spu
Allow:  /dianpu
Allow:  /oversea
Allow:  /list
Allow:  /ershou
Allow: /$
Disallow:  /

User-Agent:  360Spider
Allow:  /article
Allow:  /oshtml
Allow:  /ershou
Disallow:  /

User-Agent:  Yisouspider
Allow:  /article
Allow:  /oshtml
Allow:  /ershou
Disallow:  /

User-Agent:  Sogouspider
Allow:  /article
Allow:  /oshtml
Allow:  /product
Allow:  /ershou
Disallow:  /

User-Agent:  Yahoo!  Slurp
Allow:  /product
Allow:  /spu
Allow:  /dianpu
Allow:  /oversea
Allow:  /list
Allow:  /ershou
Allow: /$
Disallow:  /

User-Agent:  *
Disallow:  /

其他爬虫,不允许爬取

User-Agent: *

DisalloW: /

这是一个君子协定,‘爬亦有道‘

这个协议为了让搜索引擎更有效搜索自己的内容

 

爬虫基础 - Robots协议

标签:over   爬虫基础   color   user   sea   col   bsp   爬虫   引擎   

原文地址:https://www.cnblogs.com/zhaijihai/p/10300750.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!