Skip to content

This is demonstration how to solve GeeTest captcha (行为验证) with puppeteer (JavaScript) and 2captcha service

Notifications You must be signed in to change notification settings

dzmitry-duboyski/GeeTest-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | 中国语文科 | Русский

geetest captcha

Example for solving of GeeTest Captcha in JavaScript using Puppeteer library

Description

This example clearly shows how you can automate the GeeTest captcha solution. In the example, the captcha is bypassed on the demo page, but the principle of bypassing the captcha is similar everywhere.

How to start

Cloning:

git clone https://github.com/dzmitry-duboyski/GeeTest-demo.git

Installing dependencies:

npm install

Set your apikey in .env file

Start:

npm run start


GeeTest security platform is used on many popular sites. In this manual, it is described how to successfully undergo a GeeTest security check using service 2Captcha.com and Puppeteer. For a successful check of the GeeTest captcha, you must have an account in the 2Captcha.com service.

This example describes how to solve captcha GeeTest on the demo page https://2captcha.com/demo/geetest.

Description of the GeeTest solution algorithm:

  1. Find captcha parameters gt, challenge, api_server:

    1.1. You can find the value of gt in the page code. Screenshot: the gt value in the page code

    1.2 Finding the meaning of challenge is a bit more difficult. To do this, you need to find the request that the captcha makes on this page, this request must contain the value challenge.

    The response to the request will be in the following format: {"success":1,"challenge":"21aaa1c62221631516179b492b9e80cc","gt":"81388ea1fc187e0c335c0a8907ff2625"}. From this answer, you need to take the value challenge.

    If we consider the example with a captcha on the page https://2captcha.com/demo/geetest, then in this case it will be a request to https://2captcha.com/api/v1/captcha-demo/gee-test/. The response to this request contains the required challenge'. Response: {"success":1,"challenge":"21aaa1c62221631516179b492b9e80cc","gt":"81388ea1fc187e0c335c0a8907ff2625"}`.

    Screenshot: the challenge value in the page code

    You can read more about the challenge on the page.

  2. Sending captcha to API.

To solve the captcha, you need to send the found captcha parameters to the API:

"key":"your_api_key",
"method":"geetest"
"pageurl":"https://2captcha.com/demo/geetest"
"gt": "81388ea1fc187e0c335c0a8907ff2625",
"challenge": "21aaa1c62221631516179b492b9e80cc"
  1. Getting a answer for Captcha.

After successfully solving the captcha, the API will return a response with the solution. Example of a response with a solution from the API:

{
   "status": 1,
   "request": {
       "geetest_challenge": "fd4847c8a368356a0e3a6636392c2854k9",
       "geetest_validate": "4606cdf89c8c2e5a43c5a14fe475fc40",
       "geetest_seccode": "4606cdf89c8c2e5a43c5a14fe475fc40|jordan"
   }
}
  1. Using the solution. The resulting values must be inserted into the corresponding html elements of the GeeTest captcha on the page.

Example:

<div class="geetest_form">
  <input type="hidden" name="geetest_challenge" value="fd4847c8a368356a0e3a6636392c2854k9">
  <input type="hidden" name="geetest_validate" value="4606cdf89c8c2e5a43c5a14fe475fc40">
  <input type="hidden" name="geetest_seccode" value="4606cdf89c8c2e5a43c5a14fe475fc40">
</div>

Screenshot: inserting the answer into the html elements of the GeeTest captcha on the page

Done. After that, you can proceed to perform actions on the page. In this example, after that, the "Check" button is clicked.

The source code is available in the file index.js

Additional information:

About

This is demonstration how to solve GeeTest captcha (行为验证) with puppeteer (JavaScript) and 2captcha service

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published