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.
git clone https://github.com/dzmitry-duboyski/GeeTest-demo.git
npm install
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.
-
Find captcha parameters
gt
,challenge
,api_server
:1.1. You can find the value of
gt
in the page code. Screenshot: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 valuechallenge
.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 valuechallenge
.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"}`.You can read more about the
challenge
on the page. -
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"
- 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"
}
}
- 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>
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