Athlon1600/SerpScraper

google is returning empty array

mmuhd opened this issue · 6 comments

mmuhd commented

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.

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

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

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

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

with var_dump($res->html);

the result is:
string(0) ""

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

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