◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
南京SEO日志分析,抓取搜索引擎爬行痕迹的代码
Post by 南京seo, 2008-8-19, Views:对于我们南京SEO来说分析搜索引擎爬虫的痕迹是必不可少的工作,可以说根据日志的记录分析可以提前预测网站的
搜录是否正常,我们的SEO策略是否正确,优化手段是否过分等等。。我个人喜欢直接查看IIS的日志记录,然而总有
些不太喜欢看那枯燥的IIS日志,下面贴出一段抓取搜索引擎爬行痕迹的ASP代码
<%
Sub robot()
Dim robots:robots="Baiduspider+@Baidu|Googlebot@Google|ia_archiver@Alexa|IAArchiver@Alexa|ASPSeek@ASPSeek|YahooSeeker@Yahoo|SogouBot@sogou|help.yahoo.com/help/us/ysearch/slurp@Yahoo|sohu-search@SOHU|MSNBOT@MSN"
dim I1,I2,l1,l2,l3,i,rs
l2=false
l1=request.servervariables("http_user_agent")
F1=request.ServerVariables("SCRIPT_NAME")
I1=split(robots,chr(124))
for i=0 to ubound(I1)
I2=split(I1(i),"@")
if instr(lcase(l1),lcase(I2(0)))>0 then
l2=true:l3=I2(1):exit for
end if
next
if l2 and len(l3)>0 then'如果是蜘蛛,就更新蜘蛛信息
FilePath = Server.Mappath("robots/"&l3&"_robots.txt")
'记录蜘蛛爬行
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
Set Fout = Fso.OpenTextFile(FilePath,8,True)
Fout.WriteLine "索引页面:"&F1
Fout.WriteLine "蜘蛛:"&l3&chr(32)&chr(32)&"更新时间:"&Now()
Fout.WriteLine "-----------------------------------------------"
Fout.Close
Set Fout = Nothing
Set Fso = Nothing
end if
end Sub
%>