管理杂谈OA答疑ERP答疑教程搜索

[点晴永久免费OA]百度/360/头条/搜狗/bing/Google搜索引擎用到的网络爬虫介绍与识别


网络爬虫是一种自动化程序,可以按照一定的规则和算法在互联网上抓取网页信息。爬虫通过访问网页的超链接、解析页面内容等方式,收集网页数据并存储在本地或数据库中。爬虫的主要功能包括发现新网页、下载网页内容、解析网页结构、提取有用信息等。

然而爬虫访问网站可能会占用服务器资源,浪费流量,甚至可能造成服务器宕机,为了应对这些问题,识别爬虫并进行拦截屏蔽是至关重要的。

一种常见的识别爬虫的方法是通过User Agent(简称 UA),即用户代理,这是一个特殊的字符串头,使服务器能够识别客户端的操作系统、浏览器等信息。不同的爬虫有不同的User Agent,比如百度蜘蛛(Baiduspider)、360蜘蛛(360 Spider)、头条搜索蜘蛛(Bytespider)等,不同的爬虫通常会有其独特的User Agent标识,通过识别这些标识,网站管理员可以初步判断来访者是否为爬虫,并据此采取相应的拦截措施。

以下国内外常见的UA特征:

国内

    Baiduspider

Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html

Mozilla/5.0 (Linux;u;Android 4.2.2;zh-cn;) AppleWebKit/534.46 (KHTML,like Gecko)  Version/5.1 Mobile Safari/10600.6.3 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)


360Spider

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36; 360Spider

以下为360搜索的蜘蛛IP段:   180.153.232.*    180.153.234.*    180.153.236.*    180.163.220.*    42.236.101.*    42.236.102.*    42.236.103.*    42.236.10.*    42.236.12.*    42.236.13.*    42.236.14.*    42.236.15.*    42.236.16.*    42.236.17.*    42.236.46.*    42.236.48.*    42.236.49.*    42.236.50.*    42.236.51.*    42.236.52.*    42.236.53.*    42.236.54.*    42.236.55.*    42.236.99.*


    Bytespider   头条搜索(字节跳动)

Mozilla/5.0 (compatible; Bytespider; https://zhanzhang.toutiao.com/) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.0.0 Safari/537.36

Mozilla/5.0 (Linux; Android 5.0) AppleWebKit/537.36 (KHTML, like Gecko) Mobile Safari/537.36 (compatible; Bytespider; https://zhanzhang.toutiao.com/)

Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.36 (KHTML, like Gecko) Version/7.0 Mobile Safari/537.36 (compatible; Bytespider; https://zhanzhang.toutiao.com/)

头条搜索ip字段介绍

头条搜索的ip字段总共涉及10个ip,具体字段如下:

sougou spider

sogou spider User-Agent字段:

Sogou web spider 和 Sogou inst spider


国外

bingbot

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) Chrome/

Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)W.X.Y.Z Safari/537.36

Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/W.X.Y.Z Mobile Safari/537.36  (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)


Googlebot

   

 [Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)            

     

YanDexBot

Mozilla/5.0 (compatible; YandexAccessibilityBot/3.0; +http://yandex.com/bots)

Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)

除了User Agent外,还有robots协议,即爬虫协议,网站可以通过robots.txt文件告诉搜索引擎哪些页面可以抓取,哪些页面不能抓取。正常搜索引擎均遵守robots协议,但是,这个robots协议不是防火墙,也没有强制执行力强制执行力,恶意搜索引擎完全可以忽视robots.txt文件去抓取网页的快照。因此,我们不能仅仅依赖robots.txt来保护网站资源安全。相反,我们应该采取多种手段相结合的策略,包括识别User Agent、分析IP地址、监控爬虫行为等,以实现对恶意爬虫的有效拦截。

参考链接:

https://help.baidu.com/question?prod_id=99&class=0&id=3001

https://zhanzhang.toutiao.com/page/outer/docs/26899

http://www.so.com/help/spider_ip.html

https://help.sogou.com/guide.html

http://www.bing.com/webmasters/help/which-crawlers-does-bing-use-8c184ec0

https://www.pdflibr.com/crawler/googlebot

https://yandex.com/support/webmaster/robot-workings/check-yandex-robots.html


更多精彩文章浏览...
点击右上角图标分享到朋友圈
官方网站:http://www.clicksun.cn
咨询热线:400-186-1886
服务邮箱:service@clicksun.cn