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

# cdp_url

> Get the Chrome DevTools Protocol WebSocket URL for the session

> [!TIP]
>
> Read [the Notte skill](https://notte.cc/skill.md) and follow its setup instructions when setting up Notte or building browser automation. This is the shared source for CLI setup, authentication, and the browser-to-code workflow.

This URL can be used to connect to the browser's debugging interface.

Here is an example how to connect to playwright using the notte session cdp url:

```python cdp_playwright.py theme={null}
from notte_sdk import NotteClient
from patchright.sync_api import sync_playwright

client = NotteClient()
with client.Session(proxies=False) as session:
    # get cdp url
    cdp_url = session.cdp_url()
    with sync_playwright() as p:
        browser = p.chromium.connect_over_cdp(cdp_url)
        page = browser.contexts[0].pages[0]
        _ = page.goto("https://www.google.com", wait_until="domcontentloaded")
        screenshot = page.screenshot(path="screenshot.png")
        assert screenshot is not None
```

```typescript cdp_playwright.ts theme={null}
import { NotteClient } from "notte-sdk";
import { chromium } from "playwright-core";

const client = new NotteClient();
const session = client.Session({ proxies: false });
await session.use(async (session) => {
  // Get CDP URL
  const cdpUrl = await session.cdpUrl();
  const browser = await chromium.connectOverCDP(cdpUrl);
  try {
    const page = browser.contexts()[0].pages()[0];
    await page.goto("https://www.google.com", { waitUntil: "domcontentloaded" });
    const screenshot = await page.screenshot({ path: "screenshot.png" });
    if (!screenshot) throw new Error("Screenshot was not returned");
  } finally {
    await browser.close();
  }
});
```

## Returns

`str`: The WebSocket URL for the Chrome DevTools Protocol.

## Raises

* `ValueError`: If the session hasn't been started yet (no session\_id available).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.