How to bypass Google captcha with Selenium and Python?

user11960891 picture user11960891 · Nov 15, 2019 · Viewed 45.2k times · Source

I want to know how to bypass Google captcha using Selenium and Python. When I try to scrap something, Google give me captcha, can I bypass Google captcha with Selenium Python?

As an example it's Google reCAPTCHA you can see this captcha via this link: https://www.google.com/recaptcha/api2/demo

Answer

DebanjanB picture DebanjanB · Nov 15, 2019

To start with using Selenium's Python clients you should avoid solving/bypass google .


Selenium

Selenium automates browsers. Now what you what to achieve with that power is entirely up to individuals but primarily it is for automating web applications through browser clients for testing purposes and of coarse it is certainly not limited to that.


Captcha

On the other hand, Captcha (the acronym being ...Completely Automated Public Turing test to tell Computers and Humans Apart...) is a type of challenge–response test used in computing to determine if the user is human.

So, Selenium and Captcha serves two completely different purpose and ideally shouldn't be used to achieve any interrelated tasks.

Having said that, can easily detect the network traffic and identify your program as a Selenium driven BOT.


Generic Solution

However there are some generic approaches to avoid getting detected while web-scraping:


This usecase

However in a couple of usecases we were able to interact with the reCAPTCHA using Selenium and you can find more details in the following discussions:


References

You can find a couple of related discussion in:


tl; dr