Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google showing mobile search results #35

Open
nsetiono opened this issue Aug 31, 2020 · 1 comment
Open

Google showing mobile search results #35

nsetiono opened this issue Aug 31, 2020 · 1 comment

Comments

@nsetiono
Copy link

nsetiono commented Aug 31, 2020

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

@Athlon1600
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants