Athlon1600 / SerpScraper

:mag_right: Google/Bing search results scraping using PHP. Tested and working / May 13, 2020
93 stars 38 forks source link

google is returning empty array #29

Closed mmuhd closed 4 years ago

mmuhd commented 4 years ago

Hi, thank you for this amazing tool, I am trying to use it, the bing implementation is just fine, but using google always return zero results, empty array, please is there a way to rectify that? thanks.

Athlon1600 commented 4 years ago

Seems to all work fine from my end?

Have you checked if there's maybe an error that you're getting? Because that would explain why you would be getting zero results. What is the output that you get from this?

$google = new GoogleSearch();
$res = $google->search('google');
var_dump($res->results);
var_dump($res->error);
mmuhd commented 4 years ago

Hi @Athlon1600 Thank you for the quick reply. This is the result of the var_dump:

array(0) { } string(0) ""

Athlon1600 commented 4 years ago

okay.. I can't replicate this from my end. One more thing you could try for me: ^ run that same code again, and just add this at the end:

var_dump($res->html);
mmuhd commented 4 years ago

with var_dump($res->html);

the result is: string(0) ""

Athlon1600 commented 4 years ago

okay... just pushed something through. Can you try downloading the latest dev version of SerpScraper:

composer require athlon1600/serpscraper dev-master

and rerun those lines again?

mmuhd commented 4 years ago

Woow thank you so much @Athlon1600 I have updated it and it is working perfectly. Thank you once again.