> ## 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.

# Debugging

> Open DevTools for a running browser and inspect failed page loads, selectors, and network requests.

Open DevTools while the failing session is still running. You can inspect its DOM, console, and network requests, and compare what the browser received with what your code expected.

<span id="getting-to-devtools" />

## Attach DevTools

The start response includes `inspector` at the top level. This is an excerpt:

```json theme={null}
{
  "inspector": {
    "list": "https://YOUR_API_HOST/proxy/INTERNAL_UUID/inspector",
    "pages": [{
      "page_url": "about:blank",
      "devtools_url": "devtools://devtools/bundled/inspector.html?ws=..."
    }]
  }
}
```

Copy the returned `devtools_url` into Chrome's address bar. Use the actual URL from your response; the example above is abbreviated.

Open `inspector.list` to find the current pages, including tabs created after startup. The inspector URLs work only while the session is running.

An idle DevTools tab does not count as activity. With the default `inactive_kill_timeout` of 30 seconds, the browser can stop while you read the page. Start the session with a longer value for manual inspection; see [the browser stopped by itself](/troubleshooting#the-browser-stopped-by-itself).

<Note>
  A session's connection and inspector URLs grant access to its live browser. Keep them out of public logs, screenshots, and client-side code served to unrelated users.
</Note>

## The DevTools HTTP endpoints

Surfsky also proxies Chrome's discovery endpoints:

```bash theme={null}
curl "$SURFSKY_API_BASE_URL/proxy/$INTERNAL_UUID/json/version"
curl "$SURFSKY_API_BASE_URL/proxy/$INTERNAL_UUID/json/list"
```

Set `INTERNAL_UUID` to the value from the start response. Use the returned WebSocket address when connecting an automation client.

<span id="common-findings" />

## Inspect a failing job

| What you see                              | What to inspect next                                                                        |
| ----------------------------------------- | ------------------------------------------------------------------------------------------- |
| An element is missing                     | Check the current URL, frames, language, and whether a challenge replaced the page.         |
| The element appears after your code fails | Wait for the relevant selector or response instead of adding a fixed delay.                 |
| A blank or incomplete page                | Check failed network requests, blocked resources, and console errors.                       |
| A login page after restoring a profile    | Check storage options and whether the script used the default browser context.              |
| A CAPTCHA that does not progress          | Check solver settings, events, and provider balance.                                        |
| CDP disconnects                           | Check `/profiles/active`, the idle timeout, and whether another worker stopped the session. |

Keep the failure reproducible with one browser before increasing concurrency. DevTools can change timing, so also test the corrected script without it attached.

<span id="reading-the-pages-requests" />

## Reading the page's requests

The Network panel can show whether the data you need arrived in a response before the page rendered it. If that response contains the required fields, you can capture it instead of extracting each field from the DOM.

The SDKs expose `capture_responses` in [Python](/sdk/python) and `captureResponses` in [TypeScript](/sdk/typescript). Enable capture before triggering the request. Avoid logging response bodies containing credentials or account data.

<span id="screencast" />

## Watch it run

Use [Screencast](/screencast) for a live, view-only image of the page. It is useful for observing layout changes or a challenge flow without opening the full DevTools interface.

## Getting help

Send a minimal reproduction, approximate UTC time, HTTP status, and the `x-cloud-tracing-uuid` response header to [support](mailto:hello@surfsky.io). Include the `internal_uuid` only in a private support conversation if needed.

Remove API tokens, proxy passwords, cookies, personal data, and live browser URLs from the reproduction. See [troubleshooting](/troubleshooting) for common causes to check first.
