Skip to main content
The PerimeterX solver handles the press-and-hold challenge using the browser page.

Before you start

Use the CAPTCHA setup example to start a browser with anti_captcha.enabled: true and create a page-level cdp session. The snippets below use an async Playwright or Puppeteer session after navigating to your target. Configure a Gemini key on the account or pass it as anti_captcha.gemini_api_key when starting the session.

Manual solving

Wait for the challenge to appear, then send:
The timeout is in milliseconds. Detection can raise a CDP error when the expected challenge is absent. After success, wait for a selector or response that identifies the protected content.

Automatic solving

Include "perimeterx" in anti_captcha.auto_captcha_types at startup. Attach solve event listeners, then start detection before navigating:
status: "started" confirms the background loop started. Observe failures and use a bounded wait for your page result. Keep the CDP session connected until the job completes.

If solving fails

Keep the page in the same session while solving. Avoid clicking or navigating concurrently with the hold action. A completed hold does not prove the site has released the protected content. Check solver configuration, inspect one attempt in DevTools, and record the result or error before retrying. Stop the browser when the job ends.