« 改密码的 expect 脚本 附送加用户的 shell 脚本 | Main | 更新 ipcn proxy allow.site 顺便去掉了微软系列网站 »
July 8, 2006
过滤搜索引擎agent的python代码
|
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。 http://windtear.net/archives/2006/07/08/001024.html http://windtear.net/archives/2006/07/08/001024.html 过滤搜索引擎agent的python代码 在一个大循环里面 # deal with useragent spider = agent.find('Yahoo! Slurp') if spider != -1: continue spider = agent.find('Baiduspider') if spider != -1: continue spider = agent.find('Googlebot') if spider != -1: continue 这几家搜索引擎爬虫/Spider的UserAgent信息为: Mozilla/5.0 (compatible; Yahoo! Slurp China; http://misc.yahoo.com.cn/help.html) Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp) Baiduspider+(+http://www.baidu.com/search/spider.htm) Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) |
Posted by windtear at July 8, 2006 11:48 PM
Trackback Pings
TrackBack URL for this entry:
http://cgi.windtear.net/cgi-bin/wt-tb.cgi/1024
Listed below are links to weblogs that reference 过滤搜索引擎agent的python代码:
» 改进过滤搜索引擎agent的python代码 from windtear 追求完美
http://windtear.net/archives/2006/08/28/001068.html 改进过滤搜索引擎agent的python代码 大循环里面的代码 可以根据情况调整前后位置 # deal with useragent if agent.find('Yahoo! Slurp') != -1: spider = True elif agent.find('Baiduspider') != -1: spider = True... [Read More]
Tracked on August 30, 2006 10:24 AM
Comments
Post a comment
【我爱网络】
2007-12-31 23:51 2007年度 ipcn.org/ipchina.org 总结报告
2007-12-31 00:31 vmware gsx server service
2007-12-31 00:15 squid 对 404 302 缓存的相关问题
2007-12-30 14:24 升级到 MovableType 3.3x 并修改 entry_basename 兼容性
2007-12-30 13:52 [php] realip judge 前面补0的ip格式剔除
2007-12-14 16:34 rm -rf * 系统管理员要排查的定时炸弹
2007-12-13 19:03 山西的宽带运营商太过分了 私自窜改dns解析
2007-12-13 16:35 F5 MIB 再学习 唯一性标记用地址的小bug
2007-12-11 22:15 perl 用Spreadsheet::WriteExcel写了个处理/读写excel的小程序
2007-12-11 13:39 perl 变量转义的问题