close

How can I bypass the Google CAPTCHA with Selenium and Python?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How can I bypass the Google CAPTCHA with Selenium and Python in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How can I bypass the Google CAPTCHA with Selenium and Python?

  1. How can I bypass the Google CAPTCHA with Selenium and Python?

    If you want an additional layer of stability in your scrapes, you should export several cookies and have your script randomly select one of them each time you ping Google.

  2. bypass the Google CAPTCHA with Selenium and Python

    If you want an additional layer of stability in your scrapes, you should export several cookies and have your script randomly select one of them each time you ping Google.

Method 1

In order to bypass the CAPTCHA when scraping Google, you have to manually solve a CAPTCHA and export the cookies Google gives you. Now, every time you open a Selenium WebDriver, make sure you add the cookies you exported. The GOOGLE_ABUSE_EXEMPTION cookie is the one you’re looking for, but I would save all cookies just to be on the safe side.

If you want an additional layer of stability in your scrapes, you should export several cookies and have your script randomly select one of them each time you ping Google.

These cookies have a long expiration date so you wouldn’t need to get new cookies every day.

Method 2

Clear Browsing History, cached data, cookies and other site data First Create an Google Account while you are in browser window opened by selenium. Sign in to your account

wd.get("https://accounts.google.com/signin/v2/identifier?hl=en&passive=true&continue=https%3A%2F%2Fwww.google.com%2F%3Fgws_rd%3Dssl&ec=GAZAmgQ&flowName=GlifWebSignIn&flowEntry=ServiceLogin");
    Thread.sleep(2000);
    wd.findElement(By.name("identifier")).sendKeys("Email"+Keys.ENTER);
    Thread.sleep(3000);
    wd.findElement(By.name("password")).sendKeys("Password"+Keys.ENTER);
    Thread.sleep(5000);

Then Open any website that uses recaptcha tick on checkmark using this code

String framename=wd.findElement(By.tagName("iframe")).getAttribute("name");
            wd.switchTo().frame(framename);
    wd.findElement(By.xpath("//span[@id='recaptcha-anchor']")).click();

You won’t find any Puzzles or anything.

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read