Block reference / Web interaction
Solve captcha
Have 2Captcha, Anti-Captcha or CapSolver solve a reCAPTCHA, hCaptcha or Turnstile, and fill the answer into the page.
Only in
WarpX Browser
Use Solve captcha on a page that shows a captcha you cannot get past by hand on hundreds of profiles: a sign-up form, a sign-in, a checkout. The block finds the captcha's site key on the page, has a solving service work out the answer, puts the answer where the page's form looks for it and calls the page's own callback. You pay the service per captcha, with your own API key.
Settings
- Solving service
2Captcha, Anti-Captcha or CapSolver. You need an account with balance at the one you choose.
Example2Captcha- API key
The key from your account page at the service. Keep it in Databases → Credentials and write
{{secrets.captchaKey}}, so it is not saved in the workflow and shows as••••••in the log.Example{{secrets.captchaKey}}- Captcha
The kind on the page: reCAPTCHA v2 (the "I'm not a robot" box or an image challenge), reCAPTCHA v3 (invisible, scores the visitor), hCaptcha, or Cloudflare Turnstile. CapSolver does not solve hCaptcha; the panel says so in red when you pick both.
ExamplereCAPTCHA v2- Site key
The captcha's public key. Leave it empty and the block reads it from the page: from
data-sitekey, from the captcha's frame, or for reCAPTCHA v3 from the script address. Fill it in only when the page hides it, for example6LcR_okUAAAAAPYrPe-HK_0RULO1aZM15ENyM-Mf.Example- Invisible reCAPTCHAwhen Captcha is reCAPTCHA v2
Tick it when the page uses reCAPTCHA v2 without a visible box, the kind that runs when you press the form's button.
ExampleUnchecked- Page actionwhen Captcha is reCAPTCHA v3
The action name the page gives reCAPTCHA v3, found in its code as
grecaptcha.execute(key, {action: 'signup'}).verifyon a new block. A wrong action can make the site reject the token.Examplesignup- Minimum scorewhen Captcha is reCAPTCHA v3
The reCAPTCHA v3 score to ask the service for, from
0.1to0.9.0.7on a new block. Higher scores cost more and take longer.Example0.7- Fill the answer into the page and tell the page
Puts the token into the form's hidden response field and calls the page's captcha callback, which is how most pages learn the captcha was passed. Off, the block only fetches the token, for you to use yourself.
ExampleChecked- Give up after (ms)
How long to wait for the service, in milliseconds.
180000(three minutes) on a new block; anything under30000counts as 30 seconds. Past it, the block leaves by its fallback output.Example180000- Assign to variable
Keeps the token in a variable. On for a new block.
ExampleChecked- Variable namewhen Assign to variable is ticked
The variable that receives the token.
captchaTokenon a new block.ExamplecaptchaToken
Every block also has the shared block settings — a description, Disable block and what to do on an error. Fields that take text accept data from earlier blocks.
What it hands on
The token goes to the variable you named ({{variables.captchaToken}}) and on as {{prevBlockData}}. The log line says what happened: Solved by 2Captcha, filled in and the page told when the page's callback was found and called, Solved by 2Captcha, filled in when it was not. The block leaves by its top output. When the service does not finish within Give up after (ms), it leaves by its fallback output with 2Captcha did not solve it in time; with no fallback connected, the run stops with that error.
Example: Get past the reCAPTCHA on a sign-up form
- Start
- Open URL
- Forms
- Solve captcha
- Click element
- Create an account at 2Captcha, add balance, and copy the API key from your dashboard. Save it in Databases → Credentials as
captchaKey. - Add Open URL with
https://forum.example.com/registerand fill the form with Forms. - Add Solve captcha. Leave Solving service on 2Captcha, set API key to
{{secrets.captchaKey}}and Captcha to reCAPTCHA v2. - Leave Site key empty so the block reads it from the page, and leave Fill the answer into the page and tell the page ticked.
- Add Click element on the form's Register button: many sites wait for that click even after the captcha is passed.
- From the fallback output, add Take screenshot and a Telegram message, so a captcha that was not solved in time is reported rather than lost.
- Run it. After 15 to 60 seconds the log reads
Solved by 2Captcha, filled in and the page told, the box shows as ticked, and the form is sent.
Good to know
- Run it on the page that shows the captcha, in the tab the workflow is working in. With no site key on that page and none typed in, the block fails with
No captcha site key on the page. - Only running out of time goes to the fallback. A wrong key, an empty balance or an unsolvable captcha stops the block with the service's own message, such as
2Captcha: ERROR_ZERO_BALANCE. - Some sites accept the token only when the form is sent, and do nothing when the callback is called. Add Click element on their submit button after this block.
- The service's workers solve the captcha from their own addresses, not from the profile's proxy. Most sites accept that; a site that ties the token to the visitor's IP may not.
- reCAPTCHA Enterprise is recognised from the page and sent as such to 2Captcha and Anti-Captcha.
- Talking to the service goes from this computer, not through the profile's browser. The answer is then filled into the page in the profile.
See also
- Forms — Fill a text field, choose a dropdown option, or tick a checkbox or radio button.
- Click element — Click an element on the page, with human-like mouse movement by default.
- Wait for — Wait until an element appears or goes, the address matches, or a network response arrives.
- Take screenshot — Captures the visible page, the whole page or one element as an image, and saves it as a file, in the table or in a variable.