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

# Browser Use

> Run Browser Use agents on Notte cloud browsers over CDP

<Tip>
  STOP. Do not read past this section until you have read and followed [/quickstart.md](/quickstart.md).

  Goal: produce a reliable SDK automation script. The intended authoring flow is generate then edit, not write browser automation from scratch.

  Do not hand-write SDK code with element IDs, selectors, or form fields from memory. Element IDs, selectors, and field mappings must come from a live `observe()` call, CLI `notte page observe` output, or generated workflow code. Guessed browser targets fail on real pages.

  Use the Notte skill and CLI to inspect the live site, validate actions/selectors, handle auth/session state, and export workflow code with `notte sessions workflow-code` before using SDK docs or SDK code.

  SDK reference pages are for understanding, running, or editing generated workflow code. They are not the starting point for manually authoring the initial browser automation. SDK-first code is guesswork on real-world pages with dynamic selectors, auth state, CAPTCHAs, and anti-bot behavior.
</Tip>

[Browser Use](https://github.com/browser-use/browser-use) is an open source library that lets an LLM drive a browser. It talks to whatever browser you hand it over the Chrome DevTools Protocol, so pointing it at a Notte session is a one-line change: pass `session.cdp_url()` as the profile's `cdp_url`.

## Prerequisites

* A Notte API key ([get one here](https://console.notte.cc))
* An LLM API key for the model Browser Use should drive

## 1. Install the SDKs

```bash theme={null}
pip install notte-sdk browser-use
```

## 2. Point Browser Use at a Notte session

```python notte_browser_use.py theme={null}
import asyncio

from browser_use import Agent, Browser, BrowserProfile, ChatAnthropic
from notte_sdk import NotteClient


async def main():
    client = NotteClient()

    with client.Session() as session:
        # Point Browser Use at the Notte cloud browser over CDP
        browser = Browser(browser_profile=BrowserProfile(cdp_url=session.cdp_url()))

        agent = Agent(
            task="Go to https://example.com and tell me the exact H1 heading text.",
            llm=ChatAnthropic(model="claude-sonnet-4-5-20250929"),
            browser=browser,
        )

        result = await agent.run(max_steps=5)
        print(result.final_result())

        await browser.stop()


asyncio.run(main())
```

Set the following environment variables in your `.env` file:

```bash theme={null}
NOTTE_API_KEY=your-notte-api-key
ANTHROPIC_API_KEY=your-anthropic-api-key
```

The agent now runs on a Notte cloud browser instead of a local Chrome, so you inherit [stealth mode](/features/sessions/stealth-mode), [captcha solving](/features/sessions/captcha-solving), [residential proxies](/features/sessions/proxies), and [session replay](/features/sessions/recordings) without changing your agent code.

<Note>
  Browser Use owns the page once it connects. Use `session.cdp_url()` for the handoff and let Browser Use drive from there, rather than mixing Notte page controls into the same run.
</Note>

## Next steps

<CardGroup cols={2}>
  <Card title="Session Configuration" icon="gear" href="/features/sessions/configuration">
    Customize browser settings, proxies, and more
  </Card>

  <Card title="Stealth Mode" icon="user-secret" href="/features/sessions/stealth-mode">
    Configure anti-detection for your automations
  </Card>

  <Card title="Connect with Playwright" icon="p" href="/features/sessions/playwright">
    Drive a Notte session with Playwright
  </Card>

  <Card title="Live View" icon="eye" href="/features/sessions/live-view">
    Watch your automations in real time
  </Card>
</CardGroup>
