serp-spider / search-engine-google

:spider: Google client for SERPS
https://serp-spider.github.io
Other
167 stars 61 forks source link

Error with captcha #57

Open trippo opened 7 years ago

trippo commented 7 years ago

I obtain error when i have captcha return

Fatal error: Uncaught Serps\SearchEngine\Google\Exception\GoogleCaptchaException in /vendor/serps/search-engine-google/src/GoogleClient.php on line 112 Serps\SearchEngine\Google\Exception\GoogleCaptchaException: in /vendor/serps/search-engine-google/src/GoogleClient.php on line 112

gsouf commented 7 years ago

Hi @trippo that's because google detected you are a bot and prompted for a captcha, you can see how to handle this exception here: https://serp-spider.github.io/documentation/search-engine/google/handle-errors/#captcha-errors

At the moment the library does not provide a way to solve these captchas

trippo commented 7 years ago

@gsouf how can i complete manually the captcha?

gsouf commented 7 years ago

Hi @trippo

Unfortunately the process of doing it manually would be very unconvenient with the current version of the library.

I might provide on the document if you like, but still that will be painful to implement.

There is some new tools that would make it easyer for the incomming version 0.2 but the release date is not planed yet.

LunarDevelopment commented 6 years ago

I don't have enough evidence to back this up, but my experiences is:

I've manually taken the captcha URL from SERP error results and solved it in my browser and it hasn't allowed further scraping from that IP - I suspect Google checks who it served the Captcha to and if it's not the same session (?) solving it, they will re-issue a captcha.

gsouf commented 6 years ago

When you resolve a captcha there is a cookie that will allow you to query again for a given time. Solving the captcha itself is not enough

LunarDevelopment commented 6 years ago

That explains why it didn't work for me, thanks for the insight.

So any integrations with captcha solves will require CookieJar or similar ?

gsouf commented 6 years ago

Yes indeed. That's why version 0.2 added the browser interface that wraps everything required for easing auth via cookies/ip/UA

neutronixx commented 5 years ago

Hi, how I can solve the captcha error in v 0.2?

Thanks!