搜索引擎爬虫

搜索引擎爬虫(优质引流???)

最近发现服务器日志上多了一些奇怪的日志

{"remote_addr":"203.208.60.66","remote_user":"","time_local":"25/Oct/2021:14:34:27 +0800","request":"POST /api/v9494/service-global/anonymity/search/aggsSearch HTTP/1.1","status":"403","body_bytes_sent":"196","referer":"https://cydar.cn/search?(((location%3A%E4%B8%AD%E5%9B%BD%20%26%26%20owner%3D%3D%E9%98%BF%E9%87%8C%E4%BA%91%20%26%26%20port%3D%3D80%20%26%26%20app%3D%3D2.0%20%26%26%20os%3D%3DWindows%20%7C%7C%20app%3D%3D7.5)%20%26%26%20device%3D%3D%E7%BD%91%E7%BB%9C%E5%AE%89%E5%85%A8%E7%B3%BB%E7%BB%9F)%7C%7Capp%3D%3D9.4.z-SNAPSHOT)%7C%7Cdevice%3D%3D%E8%B7%AF%E7%94%B1%E4%BA%A4%E6%8D%A2%E7%B3%BB%E7%BB%9F","http_user_agent":"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)","http_x_forwarded_for":"","http_user":"","request_body":"","request_time":"0.000"}

从上可以看出:Googlebot在爬取本站内容,于是打算对谷歌爬虫进行了解。

常见搜索爬虫

1、Googlebot

Googlebot 是 谷歌 的网络爬虫,其UA标识为 “(compatible; Googlebot /2.1; +http://www.google.com/bot.html)”。对大部分网站,Googlebot应该是爬取最勤快的爬虫,能给优质博客带来大量流量。

除了爬取网页的Googlebot,常见的还有图片爬虫Googlebot-Image、移动广告爬虫Mediapartners-Google等。

2、Baiduspider

Baiduspider 是 百度 的网页爬虫,中文站很常见。其UA标识为“(compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)”。

除了网页爬虫,手机百度爬虫Baiduboxapp、渲染抓取Baiduspider-render等。

3、bingbot

bingbot 是微软 bing搜索 的爬虫,其UA标识为“(compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)”。

自微软推广bing搜索品牌后,微软原来的爬虫MSNBot越来越少见到了。

4、360Spider

360Spider 是 360搜索 的爬虫,其UA标识为“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/5 37.36; 360Spider”。

目前360搜索份额较少,这个爬虫不是很常见。

5、Sogou web spider

Sogou web spider 是 搜狗搜索 的网页爬虫,其UA标识为“Sogou web spider/4.0(+http://www.sogou.com/docs/help/ webmasters.htm#07)”。背靠腾讯,搜狗目前市场份额在上升,因此其网络爬虫比较勤快,经常能看到。

访问日志搜索Sogou,除了Sogou web spider,还常见SogouMSE、SogouMobileBrowser。这是搜狗手机浏览器的UA标识,不是爬虫。

6、YisouSpider

YisouSpider 是 神马搜索 的爬虫,UA标识是“Mozilla/5.0 (Windows NT 6.1; Win64 ; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 YisouSpider/5.0 Safari/537.36”。

神马成立初期太疯狂抓取网页导致一些小网站崩溃而惹的天怒人怨。随着市场份额提升和数据完善,目前YisouSpider还算克制,不再疯狂抓取。

从名字上看,神马搜索的发音类似于宜搜,但和专注小说搜索的“宜搜(http://easou.com/)”不是同一家公司。神马搜索是UC合并到阿里后推出的移动搜索引擎,而宜搜在2G wap时代就已经名声在外。

7、YandexBot

YandexBot 是俄罗斯最大搜索引擎和互联网巨头 Yandex 的网页爬虫,其UA标识是“(compatible; YandexBot/3.0; +http://yandex.com/bots)”。

Yandex提供中文界面和中文搜索,也是少数目前能直接打开的国外搜索引擎。随着越来越多中国人知道Yandex,YandexBot在中文网站日志里越来越常见。

8、DuckDuckGo

DuckDuckGo 是 DuckDuckGo 的网页爬虫,其UA标识是“Mozilla/5.0 (Linux; Android 10) AppleWebK it/537.36 (KHTML, like Gecko) Version/4.0 Chrome/81.0.4044.138 Mobile Safari/537.36 DuckDuckGo/5”。

DuckDuckGo 主打隐私、安全、不监控用户记录,界面简洁,也提供中文搜索界面。

垃圾爬虫

1、MJ12Bot

MJ12Bot 是英国著名SEO公司Majestic的网络爬虫,其抓取网页给需要做SEO的人用,不会给网站带来流量。

2、AhrefsBot

AhrefsBot 是知名SEO公司Ahrefs的网页爬虫。其同样抓取网页给SEO专业人士用,不会给网站带来流量。

3、SEMrushBot

SEMrushBot 也是SEO、营销公司的网络爬虫。

DotBot
DotBot 是 Moz.com 的网页爬虫,抓取数据用来支持 Moz tools 等工具。

4、MauiBot

MauiBot 不同于其他爬虫,这个爬虫连网站都没有,UA只显示一个邮箱:”MauiBot (crawler.feedback+wc@gm ail.com)“。神奇的是这个看起来是个人爬虫,竟然遵循robots协议,算得上垃圾爬虫的一股清流。

屏蔽垃圾爬虫

屏蔽垃圾爬虫主要从两方面入手:1. robots.txt禁止;2. web层面通过UA禁止。下面分别做介绍。

1、robots.txt禁止

上文列出的垃圾爬虫都遵循robots协议,因此可以通过robots.txt禁止。操作是在网站根目录新增robots.txt文件,新增如下内容:

User-agent:*
Disallow:/download.php

User-Agent: AhrefsBot
Disallow: /
User-Agent: MJ12bot
Disallow: /
User-Agent: DotBot
Disallow: /
User-Agent: SemrushBot
Disallow: /
User-Agent: MauiBot
Disallow: /
具体可参考:https://tlanyan.pp.ua/robots.txt

2、通过web软件屏蔽

对于不遵循robots协议的爬虫,可以在web软件层面通过UA屏蔽。下面以 Nginx 为例介绍,操作为:在网站配置的server段内,新增类似如下指令:

server {
   ... 一些网站配置
   # 屏蔽curl/httpclient抓取
   if ($http_user_agent ~* curl|httpclient) {
     return 403;
   }
   # 屏蔽MauiBot等爬虫
   if ($http_user_agent ~* MauiBot|AhrefsBot|DotBot) {
     return 403;
   }
   ... 其他配置

文章大部分内容并非原创,参考链接:https://tlanyan.me/common-bot-ua-and-block-bad-bots/

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值