各个搜索引擎的User-Agent

baidu:Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html) 

Google:Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

Sogou:Sogou web spider/4.0(+http://www.sogou.com/docs/help/webmasters.htm#07)

Yahoo:Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)

百度网页搜索 User-agent

Baiduspider 

无线搜索 User-agent

Baiduspider-mobile 

图片搜索User-agent 

Baiduspider-image 

视频搜索 User-agent

Baiduspider-video 

新闻搜索 User-agent

Baiduspider-news 

百度搜藏 User-agent

Baiduspider-favo 

百度联盟 User-agent

Baiduspider-cpro

谷歌User-agent

Googlebot

MSN User-agent

MSNBot

有道User-agent

YoudaoBot

搜狗User-agent

Sogou inst spider

Sogou spider2

Sogou blog

Sogou News Spider

Sogou Orion spider

即刻User-agent

JikeSpider

搜搜User-agent

Sosospider

360User-agent

360Spider


百度爬虫,第二条为百度图片爬虫

Baiduspider+(+http://www.baidu.com/search/spider.htm")

Baiduspider-image

google爬虫,最后一条为google图片搜索爬虫

Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

Googlebot/2.1 (+http://www.googlebot.com/bot.html)

Googlebot/2.1 (+http://www.google.com/bot.html)

Googlebot-Image/1.0

即刻搜索爬虫

Mozilla/5.0 (compatible; JikeSpider; +http://shoulu.jike.com/spider.html)

雅虎爬虫(分别是雅虎中国和美国总部的爬虫)

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")

新浪爱问爬虫

iaskspider/2.0(+http://iask.com/help/help_index.html")

Mozilla/5.0 (compatible; iaskspider/1.0; MSIE 6.0)

搜狗爬虫,第三条为搜狗图片爬虫

Sogou web spider/3.0(+http://www.sogou.com/docs/help/webmasters.htm#07)

Sogou Push Spider/3.0(+http://www.sogou.com/docs/help/webmasters.htm#07)

Sogou Pic Spider/3.0(+http://www.sogou.com/docs/help/webmasters.htm#07)

搜搜爬虫

Sosospider+(+http://help.soso.com/webspider.htm)

网易有道爬虫

Mozilla/5.0 (compatible; YoudaoBot/1.0; http://www.youdao.com/help/webmaster/spider/; )

MSN爬虫

msnbot/1.0 (+http://search.msn.com/msnbot.htm)



百度和360验证过。


参考:

http://hi.baidu.com/romicboy/item/afc8d8d217278d5bd63aae22

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
可以使用Java的URLConnection类来设置User-Agent,并且可以通过随机生成User-Agent来实现随机化。 以下是一个示例代码: ```java import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.Random; public class Main { private static final List<String> USER_AGENTS = new ArrayList<>(); static { // 添加一些常见的User-Agent USER_AGENTS.add("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"); USER_AGENTS.add("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586"); USER_AGENTS.add("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246"); } public static void main(String[] args) throws IOException { URL url = new URL("https://www.example.com"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("User-Agent", getRandomUserAgent()); connection.connect(); // 处理响应... } private static String getRandomUserAgent() { Random random = new Random(); int index = random.nextInt(USER_AGENTS.size()); return USER_AGENTS.get(index); } } ``` 在该示例中,我们在静态块中添加了一些常见的User-Agent,然后在获取连接时,随机选择一个User-Agent,并设置到连接的请求头中。这样就可以实现随机化User-Agent了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值