Athlon1600/SerpScraper

Google showing mobile search results

nsetiono opened this issue · 1 comments

Hello,

Sometime for certain proxy google will sending back mobile version and the code on GoogleSearch.php is only trying to find desktop version

I had use this pattern to get results from mobile version

preg_match_all('/<\/div><div><a class(.*?)href="([^"]*http[^"]+)"><span class(.*?)>(.*?)<\/span>

and the pattern below for next page in mobile version

<tbody><td><a class="([^>]*?)"([^>]*?)href="\/([^>]*?)">([^"]*'.$nextlabel.'[^"]+)<\/a>

$nextlabel variable is next word based on the google local being visited, such as in my case use "Berikutnya" for google.co.id results

Sometime for certain proxy google will sending back mobile version

google would only send you mobile version of their site based on your User Agent and not based on what IP you are connecting from. I'd have to see the exact code you're using, because I suspect you're not just changing your IP address through proxy, but also somehow changing your User Agent HTTP header