• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

How to bypass Google Captcha with python

AnonyViet by AnonyViet
February 23, 2023
in Tips
0

This article is for those of you who are doing reg tools, registering multiple accounts on the website. Or maybe it’s crawling data and getting caught in captcha without knowing how to solve it. When caught in captcha, you have to spend 3 -5 seconds to solve them. For normal users, it’s okay, but for tool users to create from a few hundred to a few thousand accounts or requests, this is not a solution. So in this article, I will show you how to solve Google captcha with Python super easy.

CAPTCHA stands for Completely Automated Public Turing test to tell Computers and Humans Apart. A CAPTCHA is a tool used to distinguish between real users and computers, such as bots. CAPTCHAs present challenges that are difficult for computers to do but relatively easy for humans. For example, identify letters or choose a traffic light in a hard-to-see photo.

CAPTCHA works by providing information to real users to decode. Traditional CAPTCHAs provide distorted or overlapping letters and numbers for user confirmation. Distorted letters make it difficult for bots to decipher and prevent access until the captcha is verified.

Since CAPTCHA was introduced, bots using machine learning have been developed. These bots are better able to verify traditional CAPTCHAs using algorithms that are trained many times over. As a result of this development, newer CAPTCHA methods based on more complex tests are born. For example, reCAPTCHA requires clicking on a specific area and waiting until the solve is successful.

Get AzCaptcha’s KeyAPI

Step 1: First, you go to AZcaptcha website and register a new account. Each newly created account will be given $0.02, you can solve 10 to 20 times depending on the type of Captcha. Note: I recommend that you use a temporary email to create an account. If you run out of money, just create another new account.

Step 2: On the dashboard page, you will see the keyAPI on the right side, copy that keyAPI.

How to bypass Google Captcha with python 4

How to bypass Google Captcha with python

First, you need to make sure your system has full python, pip. Then install 2 more packages request and bs. I will also use the site reCaptcha demo as an example in this article.

You press F12 search for keywords sitekey equal Ctrl + F.

How to bypass Google Captcha with python 5

As you can see above, the div tag has the class “g-recaptcha” and the data-sitekey is “6Le-wvk……”. In python there is a library that helps us to disassemble the html and get the data-sitekey inside the div tag bs4.

from bs4 import BeautifulSoup
import requests
from time import sleep

URL = 'https://www.google.com/recaptcha/api2/demo'

def get_siteKey(url):
    response = requests.get(url)
    soup = BeautifulSoup(response.text, "html.parser")
    g_recaptcha = soup.find_all('div', {'class' : 'g-recaptcha'})
    sitekey = g_recaptcha[0].get('data-sitekey')
    return sitekey

Next is the solve_Captcha function used to solve the captcha. You replace {keyAPI} with the API you get in the AZcaptcha page. After sending the request to solve the captcha successfully, the server will send the id of your captcha. This ID is used to identify the captcha that you send to the server. You should let the program stop for about 30 seconds for the server to solve the captcha.

def solve_Captcha(REQ_URL, url, keyAPI, sitekey):
    payload = {
        'key': keyAPI,
        'method': 'userrecaptcha',
        'googlekey': sitekey,
        'pageurl': url,
        'here': 'now'
    }
    response = requests.post(REQ_URL, data=payload)
    return response

BASE_URL = 'http://azcaptcha.com'
REQ_URL = BASE_URL + '/in.php'
RES_URL = BASE_URL + '/res.php'
keyAPI = '{keyAPI}'

response = solve_Captcha(REQ_URL, URL, keyAPI, siteKey)
if response.status_code == 200:
    print('Solving captcha...')
    id = response.text.split('|')[1]
    sleep(30)

Next, you use the get_gCaptcha function to check if the captcha has been solved. If done, we will get gCaptcha, and if not done, we continue to call the get_gCaptcha function again to check.

def get_gCaptcha(RES_URL, keyAPI, id):
    payload = {
        'key': keyAPI,
        'action': 'get',
        'id': id,
    }
    response = requests.post(RES_URL, data = payload)
    if response.text == 'CAPCHA_NOT_READY':
        print('CAPTCHA NOT READY. Try again in 30s.')
        sleep(30)
        gCaptcha = get_gCaptcha(RES_URL, keyAPI, id)
        return gCaptcha
    if 'OK' in response.text:
        gCaptcha = response.text.split('|')[1]
        return gCaptcha

Full code:

from bs4 import BeautifulSoup
import requests
from time import sleep

URL = 'https://www.google.com/recaptcha/api2/demo'

def get_siteKey(url):
    response = requests.get(url)
    soup = BeautifulSoup(response.text, "html.parser")
    g_recaptcha = soup.find_all('div', {'class' : 'g-recaptcha'})
    sitekey = g_recaptcha[0].get('data-sitekey')
    return sitekey

siteKey = get_siteKey(URL)
print(siteKey)
def solve_Captcha(REQ_URL, url, keyAPI, sitekey):
    payload = {
        'key': keyAPI,
        'method': 'userrecaptcha',
        'googlekey': sitekey,
        'pageurl': url,
        'here': 'now'
    }
    response = requests.post(REQ_URL, data=payload)
    return response
def get_gCaptcha(RES_URL, keyAPI, id):
    payload = {
        'key': keyAPI,
        'action': 'get',
        'id': id,
    }
    response = requests.post(RES_URL, data = payload)
    if response.text == 'CAPCHA_NOT_READY':
        print('CAPTCHA NOT READY. Try again in 30s.')
        sleep(30)
        gCaptcha = get_gCaptcha(RES_URL, keyAPI, id)
        return gCaptcha
    if 'OK' in response.text:
        gCaptcha = response.text.split('|')[1]
        return gCaptcha
    
BASE_URL = 'http://azcaptcha.com'
REQ_URL = BASE_URL + '/in.php'
RES_URL = BASE_URL + '/res.php'
keyAPI = '{keyAPI}'

response = solve_Captcha(REQ_URL, URL, keyAPI, siteKey)
if 'OK' in response.text:
    print('Solving captcha...')
    id = response.text.split('|')[1]
    sleep(30)
    gCaptcha = get_gCaptcha(RES_URL, keyAPI, id)
    print(gCaptcha)
else:
    print(response.text)

You have successfully obtained the gCaptcha code. Next, you just need to replace the gCaptcha code on the page you want to pass the captcha by using the excute javascript command below:

document.getElementById("g-recaptcha-response").innerHTML="{gCaptcha}";

That’s it, then. Good luck.

Tags: BypassCaptchaGooglePython
Previous Post

Instructions to find your Facebook ID

Next Post

Code Create a widget on Facebook – Multi-Function Synthesis

AnonyViet

AnonyViet

Related Posts

How to add sliders to Facebook Stories to easily rewind videos
Tips

How to add sliders to Facebook Stories to easily rewind videos

April 21, 2026
How to change the default font on Windows 10
Tips

How to change the default font on Windows 10

April 13, 2026
5 tips for using a Browser to replace an App (helps save RAM, time and money)
Tips

5 tips for using a Browser to replace an App (helps save RAM, time and money)

April 13, 2026
How to make funny MeMe photos without Photoshop within 10 seconds
Tips

How to make funny MeMe photos without Photoshop within 10 seconds

April 11, 2026
How to quickly design your own Logo without Photoshop
Tips

How to quickly design your own Logo without Photoshop

April 10, 2026
How to convert Website into App on Windows
Tips

How to convert Website into App on Windows

April 9, 2026
Next Post
Code Create a widget on Facebook – Multi-Function Synthesis

Code Create a widget on Facebook - Multi-Function Synthesis

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

Create an avatar to celebrate April 30 with a beautiful red flag shirt with yellow stars

Create an avatar to celebrate April 30 with a beautiful red flag shirt with yellow stars

April 30, 2026
How to get 2 months of Super Duolingo for free worth 300k

How to get 2 months of Super Duolingo for free worth 300k

April 30, 2026
How to create a Face Sticker Collection using ChatGPT

How to create a Face Sticker Collection using ChatGPT

April 29, 2026
How to install the cute Bongo Cat mouse pointer for Windows

How to install the cute Bongo Cat mouse pointer for Windows

April 29, 2026
Create an avatar to celebrate April 30 with a beautiful red flag shirt with yellow stars

Create an avatar to celebrate April 30 with a beautiful red flag shirt with yellow stars

April 30, 2026
How to get 2 months of Super Duolingo for free worth 300k

How to get 2 months of Super Duolingo for free worth 300k

April 30, 2026
How to create a Face Sticker Collection using ChatGPT

How to create a Face Sticker Collection using ChatGPT

April 29, 2026
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

Create an avatar to celebrate April 30 with a beautiful red flag shirt with yellow stars

Create an avatar to celebrate April 30 with a beautiful red flag shirt with yellow stars

April 30, 2026
How to get 2 months of Super Duolingo for free worth 300k

How to get 2 months of Super Duolingo for free worth 300k

April 30, 2026
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply