circle-check
Documentation has been updated: see help center and changelog in one place.

Dynamic CAPTCHA Solving

Learn about Unblocking Browser CAPTCHA detection and solving mechanisms and how to use them.

By default, Unblocking Browser automatically detects and solves CAPTCHAs immediately when a page loads. However, some websites display CAPTCHAs at later stages, such as popup windows when submitting forms or after specific user interactions.

Unblocking Browser allows you to trigger CAPTCHA detection and solving manually at any point during your session. To manually trigger CAPTCHA solving, execute the following code to send a message to the window object:

window.postMessage({action: 'solve_captcha', type: '<captcha type>'}, '*')

Supported CAPTCHA types include:

  • hcaptcha

  • recaptcha

  • turnstile (Cloudflare CAPTCHA)

Example of usage (Playwright / Puppeteer JavaScript):

// ...
await page.click('#form-submit');
// Now we know that CAPTCHA should be shown
await page.evaluate(() => {
  window.postMessage({action: 'solve_captcha', type: 'recaptcha'}, '*')
});
// Follow `oxylabs-captcha-start` and `oxylabs-captcha-end` events like a regular case
// ...

Turnstile CAPTCHA requires a different approach since it must be intercepted before it appears on screen. To do so, initiate CAPTCHA detection first, then perform the action that triggers the CAPTCHA:

// We know that our next action may trigger Turnstile CAPTCHA
await page.evaluate(() => {
  window.postMessage({action: 'solve_captcha', type: 'turnstile'}, '*')
});
await page.click('#form-submit');
// Follow `oxylabs-captcha-start` and `oxylabs-captcha-end` events like a regular case
// ...

Last updated

Was this helpful?