Working with CAPTCHA
To work with and solve captchas in A-Parser, special methods are implemented that allow sending a captcha for solving to a captcha solving service using parsers:
Util::AntiGate - solves captchas in the form of images with letters/numbers/words
Util::ReCaptcha2 - solves Google ReCaptcha v2
Util::ReCaptcha3 - solves Google ReCaptcha v3
Util::hCaptcha - solves hCaptcha captchas
Util::Turnstile - solves Cloudflare Turnstile captchas
It is also easy to solve CAPTCHA using the await this.parser.request() method.
For example, calling this method for Google ReCaptcha v2 will look as follows:
await this.parser.request('Util::ReCaptcha2', this.conf.Util_ReCaptcha2_preset, {}, siteKey + ' ' + endPoint);
You can find more details in the example from the catalog Checking website category via cyren.com service
More details about CAPTCHA bypass
await this.captcha.*
Working with captcha
.recognize(preset, image, type[, overrides])
await this.captcha.recognize(preset, image, type, overrides) - upload captcha for recognition
image- binary image data for recognitionpreset- specifies the preset for
Util::AntiGatetypespecifies one of: 'jpeg', 'gif', 'png'
The result will be a hash with fields:
answer- text from the imageid- captcha id, to allow reporting an error later via.reportBaderror- text error if answer is not set
.recognizeFromUrl(preset, url[, overrides])
await this.captcha.recognizeFromUrl(preset, url, overrides) - similar to the previous method, but the captcha will be downloaded automatically via the link (url) without using a proxy
.reportBad(preset, id[, overrides])
await this.captcha.reportBad(preset, id, overrides) - report to the service that the captcha was solved incorrectly
Useful links
🔗 ⏩ Creating JS parsers. Working with CAPTCHA
Video on how to write a JS parser with antigate support for solving captchas on pages
🔗 Creating JS parsers. Working with CAPTCHA
Article on how to write a JS parser with antigate support for solving captchas on pages
🔗 Checking site categories via cyren.com service
Example implementing Util::ReCaptcha2 connection in a JS parser