如何判断百度蜘蛛是PC蜘蛛还是移动蜘蛛?

查看UA 百度搜索对外公布过的UA是: 移动UA 1: Mozilla/5.0 (Linux;u;Android 4.2.2;zh-cn;) AppleWebKit/534.46 (KHTML,likeGecko) Version/5.1 Mobile Safari/10600.6.3 (compatible; Baiduspider/2.0;+http://www.baidu.com/ search/ spider.html) 移动UA 2: Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 likeMac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143Safari/601.1 (compatible; Baiduspider-render/2.0; +http://www.baidu.com/search/spider.html) PC UA 1: Mozilla/5.0 (compatible; Baiduspider/2.0;+http://www.baidu.com/search/spider.html) PC UA 2: Mozilla/5.0(compatible;Baiduspider-render/2.0;+http://www.baidu.com/search/ spider.html) 反查IP 可以通过DNS反查IP的方式判断某只蜘蛛是否来自百度搜索引擎。根据平台不同验证方法不同,如Linux/Windows/OS三种平台下的验证方法分别如下: 在Linux平台下,可以使用hostip命令反解IP来判断是否来自百度蜘蛛的抓取。百度蜘蛛的hostname以*.baidu.com格式命名,非*.baidu.com即为冒充。 命令如下: host [ip地址] 反查结果如下: xx.xx.xx.xx.in-addr.arpa domain name pointer baiduspider-xx-xx-xx-xx.crawl.baidu.com.
我的笔记