Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to spoof a search engine bot with curl? [closed]

How do I make a request to a website using cURL and make the website believe that I am a search engine.

like image 379
4 revs, 2 users 76% Avatar asked May 17 '13 12:05

4 revs, 2 users 76%


1 Answers

You can set your user-agent to Googlebot's (more info on the exact user-agents used on Google's KB):

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');

This might not always work though! Some websites may choose to Reverse DNS check anyone claiming to be Googlebot.

like image 68
Danny Beckett Avatar answered Sep 24 '22 15:09

Danny Beckett