> ## Documentation Index
> Fetch the complete documentation index at: https://docs.surfsky.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Image CAPTCHA

> Read text from a CAPTCHA image and submit the returned solution in your page.

The `image` solver sends an image to the configured CapMonster provider and returns recognized text. Your script must enter the text and submit the form.

<span id="overview" />

<span id="prerequisites" />

<span id="quick-start" />

## Before you start

Enable `anti_captcha.enabled`, configure a CapMonster key through your account, and create a page-level CDP session with the [CAPTCHA setup](/captcha-solving#connect-and-solve).

The image URL must be reachable by the solver's HTTP client. It is fetched separately from the browser, so browser cookies and headers are not automatically attached. A URL that works only in your logged-in tab may fail here.

## Manual solving

After navigating, obtain the absolute image URL from your page. Replace the selectors with those the site uses:

<CodeGroup>
  ```python Python (async Playwright) theme={null}
  image_url = await page.locator("img.captcha").evaluate("img => img.src")
  result = await cdp.send("Captcha.solve", {
      "type": "image",
      "timeout": 60000,
      "options": {"image_url": image_url},
  })
  if result.get("status") != "success" or not result.get("solution"):
      raise RuntimeError(result)
  await cdp.send("Human.click", {"selector": "input[name='captcha']"})
  await cdp.send("Human.type", {"text": result["solution"]})
  await cdp.send("Human.click", {"selector": "button[type='submit']"})
  ```

  ```javascript JavaScript (Playwright) theme={null}
  const imageUrl = await page.locator("img.captcha").evaluate(img => img.src);
  const result = await cdp.send("Captcha.solve", {
    type: "image",
    timeout: 60000,
    options: { image_url: imageUrl },
  });
  if (result.status !== "success" || !result.solution) {
    throw new Error(JSON.stringify(result));
  }
  await cdp.send("Human.click", { selector: "input[name='captcha']" });
  await cdp.send("Human.type", { text: result.solution });
  await cdp.send("Human.click", { selector: "button[type='submit']" });
  ```
</CodeGroup>

Automatic mode is not supported for `image`. Supply an HTTP or HTTPS image URL; the current solver fetches it as a URL and does not accept a Base64 image body.

<span id="best-practices" />

<span id="how-it-works" />

<span id="need-help" />

<span id="related" />

## Check the result

The response contains `status`, `type: "image"`, and `solution` on success. Recognition can succeed while the website rejects the answer. Wait for the site's submission result and check whether the image refreshed before the answer was entered.

If the solver fails, check the image URL's accessibility, the provider configuration, and balance. Keep the same page open so the image and form belong to the same challenge attempt. See [CAPTCHA troubleshooting](/captcha-solving#troubleshooting).
