Util::Turnstile - Cloudflare Turnstile captcha recognition
Scraper overview
This scraper is used only as a plug-in component in other scrapers where it may be necessary to solve Cloudflare Turnstile captchas, such as Ahrefs scrapers, as well as in custom JavaScript scrapers.
The principle of this scraper's operation is to send Turnstile data (usually the sitekey and the URL of the page where the Turnstile captcha was received) to a solving service and receive an alphanumeric token in response. The correctness of the solution depends solely on the solving service; as a rule, services almost always solve Turnstile correctly.
Capabilities
- Supports working with the following services: AntiCaptcha, RuCaptcha, 2captcha, CapMonster.cloud, CapSolver, captchas.io
- Ability to configure response timeout and status check delay
- Ability to solve captchas without using services. To enable this feature in Provider you must select
Auto (using Chrome). Chrome (puppeteer) is used for solving; keep this in mind when configuring the number of threads.
Use cases
- Bypassing Cloudflare Turnstile in scrapers where solving this type of captcha is optionally or mandatorily required to obtain results
Queries
The scraper accepts two types of queries:
sitekeyurlsitekeyurlproxyuser-agent
Parameters are separated by a space and mean:
sitekey- this is the Turnstile sitekeyurl- page where Turnstile is locatedproxy- proxy through which Cloudflare Turnstile was received. The parameter must be in the formatlogin:pass@ip:port@typefor proxies with authorization orip:port@typefor proxies without authorization- type can be
http,https,socks4,socks5
- type can be
user-agent- user agent with which Turnstile was received
Output results examples
$resp- Cloudflare Turnstile response (token)$error- if an error occurred, its description
Cloudflare Turnstile token output
Result format:
$resp
Result example:
0.uM0rQLy_vdWZNwOml8TMpvPgtXuqMs3H_2A7D5txxc27kHNFcGh2UOS1MQ82GiF3Dd6-VyOEgdBf1Ef3Q6xjwRYZH3V8YJdv4wgxfTtyH5stVsBOP6qWrE0Zu-txfDmJIJ_THkeK8wrYODLwj3p948zdiufJScERCVhsx1aPIurXAidPWhJslVutd4uTbMAvuGcYg7Nj-wwbW6VKGuofBHIx116Xt7_9eXISzWFy5se95e2FYVY4n4oGU3xSkoUnUCw0fcBMBP8Vik8Qde-qd53mc7YAGKeRKj9yV0t2erTc4i9ZeRjR22Fxm1nN_SkbdAHjj-oATJmxyfMAFoT_MEwe2WliuvuoPrkCAZYe8S0.QqD0sL8h2B_8jYaa792YPA.04643a6fbd94c593eee9770924ddefbd6d227e84dcfca973ab840728c122fc5d
Possible settings
The Provider parameter is used to select the service.
| Parameter | Default value | Description |
|---|---|---|
| Client key | Client key for online solving services | |
| Provider url | Provider URL, allows overriding the domain. Multiple can be specified separated by commas; the scraper will use each one randomly. Can be empty; the scraper automatically uses the correct one depending on the selected solving service | |
| Provider | AntiCaptcha | Solving service |
| Wait between get status | 5 | Delay between status checks |
| Max wait time | 300 | Maximum solving wait time |