惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - 碧海蓝天

SQL Server 附加数据库时报1813错误的解决方案 SQL Server连接数据库记录清除 CSS 滤镜 各大搜索引擎网站登录入口 Windows 7安装SQL2008的顺序 Windows服务端口大全 Kubuntu下root登录 用于中文 VS2008 的 Microsoft Silverlight Tools Beta 2发布 jQuery.ajax - 碧海蓝天 - 博客园 IE Version Vector - 碧海蓝天 主流浏览器引擎简介 IE、Firefox、Opera和Safari对CSS样式important和*的支持 - 碧海蓝天 - 博客园 Remoting和WebService有什么区别 今天俺也Hi了一把 Asp.net中DataBinder.Eval用法的总结 - 碧海蓝天 - 博客园 javascript refresh page jQuery Intellisense for Visual Studio 2008 验证手机号码的js代码 Linux自动安装命名
如何判断搜索引擎机器人(蜘蛛)有没有爬行你的站点? - 碧海蓝天 - 博客园
碧海蓝天 · 2009-10-28 · via 博客园 - 碧海蓝天

在USER_AGENT中,有相应的字符串可以判断是否是搜索引擎机器人来查找你公司的网站:

Google的机器人:包含"Googlebot"的字符

Baidu的机器人:包含"Baiduspider"的字符

Yahoo!的机器人:包含"Yahoo! Slurp"的字符

 msn的机器人:包含"msnbot"的字符

Soso的机器人:包含"Sosospider"的字符

 Sogou的机器人:包含"Sogou web spider"的字符

WebAlta的机器人:包含"WebAlta"的字符

其他知识可参考http://429006.com/article/Technology/994.htm

我们先来看一篇网上的文章:如何辨别搜索引擎机器人身份

搜索引擎派出他们的搜索机器人去访问、索引网站内容,网站管理员也默认、欢迎它们来访。但是由于搜索引擎派机器人来访会在一定程度上影响网站性能,因此并非所有的机器人都是无害的,有一些非法机器人伪装成主流搜索引擎漫游器对网站大量遍历,并且不遵循robots.txt规范,会严重拖垮网站性能而又无其它益处。因此,网站管理员需要验证每个机器人身份是否合法。

在你的服务器日志文件中,可见每次访问的路径和相应的IP地址,如果是机器人来访,则user-agent会显示Googlebot或MSNBot等搜索引擎漫游器名称,每个搜索引擎都有自己的user-agent,但仅有这个还不足以证明这个机器人的合法性,因为很多垃圾制造者可能将他们的机器人也命名为Googlebot,以伪装蒙混进入网站,大肆采掘内容。

目前,主流搜索引擎都建议网站管理员通过这种方式来辨别真实的机器人身份:通过DNS反向查询找出搜索引擎机器人IP地址对应的主机名称;用主机名查找IP地址以确认该主机名与IP地址匹配。

首先,使用DNS反向查询(Reverse DNS Lookup),找出机器人IP地址对应的主机名称。主流搜索引擎的主机名称通常情况下应是这样的:

Google:主机名称应包含于googlebot.com域名中,如:crawl-66-249-66-1.googlebot.com;

MSN:主机名称应包含于search.live.com域名中,如:livebot-207-46-98-149.search.live.com;

Yahoo:主机名称应包含于inktomisearch.com域名中,如:ab1164.inktomisearch.com。

最后,做一次DNS查询,用主机名查找IP地址(Forward DNS Lookup),以确认该主机名与IP地址匹配。由此证明该机器人是合法的。

现在,如果发现一个机器人将自己伪装成合法搜索引擎漫游器,你就可以通过服务器上的设置来阻止这个非法机器人。

SEO如何查看你网站的日志文件?

从哪里获取你的网站日志文件?

使用ftp从你网站的wwwlogs目录下载ex071227.log文件,然后进行查看,这点应该根据各空间服务商的不同情况而不同,我的空间是万网的,各位朋友可以跟空间商的技术支持取得联系,得到这些信息。

下面是2007年12月27日我的站点日志中的一条记录:

2007-12-26 16:02:17 66.249.70.57 - GET /catalog.asp 200 24254 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

从上面可以看出,Google的机器人名称为Googlebot,其地址为http://www.google.com/bot.html

而网页正常的访问记录为:

(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+2.0.50727) http://www.seo-diy.cn/Post/SEO-Thinking-Practice/letter-cizhi-jingli-right-geshi-weizhi.html

下面是紧接着上一条抓取记录的机器人爬行:

2007-12-26 16:12:06 66.249.70.57 - GET /catalog.asp 200 16337 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

可以看到,Google是在白天(中国时间,美国时间是凌晨)更新,两次抓取间隔为10分钟左右。

下面是搜索引擎蜘蛛爬行记录特别密集的一段连续的日志记录:

2007-12-26 18:34:53 203.209.240.182 - GET /favicon.ico 404 3896 HTTP/1.1 iearthworm/1.0,+iearthworm@yahoo.com.cn -

2007-12-26 19:18:33 74.6.23.134 - GET /catalog.asp 200 30721 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp) -

2007-12-26 19:19:07 74.6.28.41 - GET /Post/SEO-Thinking-Practice/blog-end-new-website-check-period.html 200 23084 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp) -

2007-12-26 19:19:18 202.160.178.30 - GET /Post/seo-tool-resource.html 200 27591 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -

2007-12-26 19:33:51 202.160.178.117 - GET /catalog.asp 200 33548 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -

2007-12-26 19:41:16 202.160.178.131 - GET /catalog.asp 200 27633 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -

2007-12-26 19:50:31 74.6.26.119 - GET /Post/seo-story-record/some-seo-questions.html 200 24525 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp) -

2007-12-26 19:59:20 66.249.70.57 - GET /catalog.asp 200 32791 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

2007-12-26 20:18:54 124.115.4.196 - GET /default.asp 200 38460 HTTP/1.1 Sosospider+(+http://help.soso.com/webspider.htm) http://www.seo-diy.cn/

2007-12-26 20:18:54 124.115.4.196 - GET /style/default.css 200 20163 HTTP/1.1 Sosospider+(+http://help.soso.com/webspider.htm) http://www.seo-diy.cn/style/default.css

2007-12-26 20:18:57 124.115.4.196 - GET /css/print.css 200 4001 HTTP/1.1 Sosospider+(+http://help.soso.com/webspider.htm) http://www.seo-diy.cn/css/print.css

2007-12-26 20:18:57 124.115.4.196 - GET /script/common.js 200 39736 HTTP/1.1 Sosospider+(+http://help.soso.com/webspider.htm) http://www.seo-diy.cn/script/common.js

2007-12-26 20:18:57 124.115.4.196 - GET /SCRIPT/navbar.js 200 1355 HTTP/1.1 Sosospider+(+http://help.soso.com/webspider.htm) http://www.seo-diy.cn/SCRIPT/navbar.js

2007-12-26 20:18:58 124.115.4.196 - GET /PLUGIN/KeyWords/KeyWords.js 200 3109 HTTP/1.1 Sosospider+(+http://help.soso.com/webspider.htm) http://www.seo-diy.cn/PLUGIN/KeyWords/KeyWords.js

2007-12-26 20:26:36 66.228.164.208 - GET /Post/SEO-Technique-Skill/twelve-month-build-a-successful-website-experience.html 206 48462 HTTP/1.1 Mozilla/5.0+(Macintosh;+U;+PPC+Mac+OS+X+Mach-O;+en-US;+rv:1.8.1.5)+Gecko/20070713+Firefox/2.0.0.5 -

2007-12-26 20:27:52 202.160.180.60 - GET /catalog.asp 200 19744 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -

2007-12-26 20:29:02 66.249.70.57 - GET /catalog.asp 200 16416 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

2007-12-26 20:30:39 209.85.238.22 - GET /rss.xml 304 141 HTTP/1.1 Feedfetcher-Google;+(+http://www.google.com/feedfetcher.html;+1+subscribers;+feed-id=11107473901409426197) -

2007-12-26 20:36:38 219.239.34.53 - GET /rss.xml 304 141 HTTP/1.1 xianguo+1+subscribers -

2007-12-26 20:40:04 202.160.179.147 - GET /Post/seo-tool-resource/my-lovest-seo-blog.html 304 142 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -

2007-12-26 20:41:55 66.249.70.44 - GET /Post/SEO-Thinking-Practice/seo-many-websites-or-single.html 304 142 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

2007-12-26 20:42:27 61.135.166.234 - HEAD /Post/SEO-Thinking-Practice/seo-lanhai-geren-team.html 200 248 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -

2007-12-26 20:44:10 66.249.70.25 - GET /Post/SEO-Thinking-Practice/seo-must-know-time.html 304 141 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

2007-12-26 21:22:44 61.135.166.234 - HEAD /catalog.asp 200 256 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -

2007-12-26 21:26:59 61.135.220.245 - GET /robots.txt 200 780 HTTP/1.1 Mozzila/1.3+(http://www.yodao.com/help/webmaster/spider/;+) -

2007-12-26 21:27:00 61.135.220.245 - GET /rss.xml 200 61515 HTTP/1.1 Mozzila/1.3+(http://www.yodao.com/help/webmaster/spider/;+) -

2007-12-26 21:38:47 202.160.180.183 - GET /catalog.asp 200 19804 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -

2007-12-26 22:00:05 202.160.180.202 - GET /catalog.asp 200 19774 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -

2007-12-26 22:00:35 61.135.166.234 - HEAD /catalog.asp 200 256 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -

2007-12-26 22:14:07 66.249.70.23 - GET /robots.txt 200 780 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

2007-12-26 22:14:07 66.249.70.41 - GET /sitemap.xml 200 5017 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

2007-12-26 22:24:26 66.249.70.57 - GET /catalog.asp 200 19947 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

2007-12-26 22:25:23 220.181.38.209 - GET /catalog.asp 200 16122 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -

2007-12-26 22:25:58 220.181.38.209 - GET /catalog.asp 200 30429 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -

2007-12-26 22:26:27 220.181.38.209 - GET /catalog.asp 200 19301 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -

2007-12-26 22:31:44 74.6.20.22 - GET /robots.txt 200 780 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp) -

2007-12-26 22:31:44 74.6.20.210 - GET /catalog.asp 200 16402 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp) -

2007-12-26 22:32:52 202.160.178.161 - GET /Post/SEO-Technique-Skill/how-to-select-keyword.html 304 142 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -

2007-12-26 22:51:44 202.160.180.63 - GET /catalog.asp 200 21409 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -

2007-12-26 22:54:45 66.249.70.57 - GET /catalog.asp 200 19771 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

2007-12-26 23:07:21 202.160.179.85 - GET /cmd.asp 200 1166 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -

这里我们可以看到很多蜘蛛的影子:

yahoo蜘蛛的名称是Yahoo!+Slurp+China 地址是http://misc.yahoo.com.cn/help.html

而百度的蜘蛛名称是Baiduspider 地址是http://www.baidu.com/search/spider.htm

SOSO的蜘蛛名称是Sosospider 地址是http://help.soso.com/webspider.htm

另外有几条记录:

2007-12-26 22:14:07 66.249.70.23 - GET /robots.txt 200 780 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

2007-12-26 22:14:07 66.249.70.41 - GET /sitemap.xml 200 5017 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

说明各搜索引擎的蜘蛛应该是先读取跟目录下的robots.txt文件,然后根据robots.txt规则进行抓取的,然后紧接着读取sitemap.xml文件,从而判断网站有没有更新。

下面这行是网易有道搜索引擎的图片蜘蛛:

2007-12-27 00:46:17 61.135.220.63 - GET /images/biaoshi.gif 404 3896 HTTP/1.1 Mozilla/5.0+(compatible;YodaoBot-Image/1.0;http://www.yodao.com/help/webmaster/spider/;) http://image.yodao.com/

下面是Google的feed抓取机器人记录:

2007-12-27 02:30:44 209.85.238.22 - GET /rss.xml 304 141 HTTP/1.1 Feedfetcher-Google;+(+http://www.google.com/feedfetcher.html;+1+subscribers;+feed-id=11107473901409426197) -

可以看见, Feedfetcher-Google是蜘蛛的名称,地址是:http://www.google.com/feedfetcher.html

哪些蜘蛛支持robots协议?

2007-12-27 03:04:47 202.160.181.217 - GET /robots.txt 200 780 HTTP/1.0 Mozilla/5.0+(compatible;+Yahoo!+Slurp+China;+http://misc.yahoo.com.cn/help.html) -

2007-12-26 22:14:07 66.249.70.23 - GET /robots.txt 200 780 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

2007-12-26 16:57:56 61.135.220.140 - GET /robots.txt 200 780 HTTP/1.1 Mozilla/5.0+(compatible;YodaoBot-Image/1.0;http://www.yodao.com/help/webmaster/spider/;) -

2007-12-27 08:57:27 61.135.166.78 - GET /robots.txt 200 799 HTTP/1.1 Baiduspider+(+http://www.baidu.com/search/spider.htm) -

可以看见Google(谷歌)、Yodao(有道)、Yahoo(雅虎)和baidu(百度)都是支持robots协议的。

哪些支持sitemap.xml协议?

2007-12-26 22:14:07 66.249.70.41 - GET /sitemap.xml 200 5017 HTTP/1.1 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) -

可以看见只有Google(谷歌)支持sitemap.xml协议。