Skip to Content
Browser API

Captcha

Turn on automatic captcha solving or control it from a script with the Captcha CDP domain.

RunHBrowser can solve captchas for you. Automatic solving is off by default.

Rolling out. The Captcha CDP domain is rolling out together with the product. Detection covers common captcha widgets only; do not assume that every captcha on every site is detected or solved.

Turn on automatic solving

Use any of these:

  • the captcha setting of a browser account, in the dashboard;
  • the captcha setting of a profile, in the dashboard;
  • the captcha-auto modifier for one session:
wss://<login>-captcha-auto:<password>@browser.runharvester.com

The usual priority order applies: the URL modifier wins over the profile, which wins over the account.

Control solving from a script

RunHBrowser adds a vendor CDP domain named Captcha.

ItemParametersMeaning
Captcha.solve{ targetId? }Solve the captcha on a page. targetId optionally names the tab.
Captcha.waitForSolve{ timeout } in millisecondsWait for a solve to finish, for up to timeout milliseconds.
Captcha.detected (event)A captcha was found on a page.
Captcha.solveFinished (event)A solve succeeded.
Captcha.solveFailed (event)A solve failed.

Puppeteer and Playwright do not know this domain, so send the commands through a CDP client. In Puppeteer, page.createCDPSession() returns one; in Playwright, context.newCDPSession(page).

import puppeteer from "puppeteer-core";

const browser = await puppeteer.connect({
  browserWSEndpoint: process.env.BROWSER_WS_URL,
});

const page = await browser.newPage();
const client = await page.createCDPSession();

client.on("Captcha.solveFinished", () => console.log("solved"));
client.on("Captcha.solveFailed", () => console.log("solve failed"));

await page.goto("https://example.com/protected");
await client.send("Captcha.solve", {});
await client.send("Captcha.waitForSolve", { timeout: 60000 });

console.log(await page.title());
await browser.close();

Billing

Captcha solving is billed per solve. A failed solve is refunded. See Billing.

Last updated on

On this page