Use this file to discover all available pages before exploring further.
AI agent instructions
STOP. Do not read past this section until you have read and followed /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.
When working with Notte sessions, you have two ways to interact with the browser: using Playwright directly via CDP, or using Notte’s AI-enabled SDK methods. Both approaches work with the same session, and you can even mix them in your automation.
When you access session.page, you get a Playwright-compatible page object that connects directly to the browser via Chrome DevTools Protocol:
playwright_direct.py
from notte_sdk import NotteClientclient = NotteClient()with client.Session() as session: page = session.page page.goto("https://example.com") page.fill("input[name='email']", "user@example.com") page.click("button[type='submit']")
This gives you the full Playwright API - everything you can do with Playwright works here. You control the browser directly through WebSocket connections with low latency.
Notte provides high-level methods designed for AI agents and structured automation:
notte_sdk_methods.py
from notte_sdk import NotteClientclient = NotteClient()with client.Session() as session: session.execute(type="goto", url="https://example.com") actions = session.observe(instructions="Fill the email input") session.execute(actions[0]) # Execute the action the AI recommends data = session.scrape(instructions="Extract all product names")
These methods use Notte’s backend to execute actions, with built-in AI capabilities, observability, and error handling.
Choose session.execute(), observe(), and scrape() when you need:
AI-powered automation - Let AI find elements and understand pages
Structured data extraction - Extract data into Pydantic models automatically
Built-in observability - Session replays, trajectory tracking, live viewer
Simpler API - Smaller learning curve, no Playwright knowledge required
Production reliability - Automatic retries, error handling, validation
Agent workflows - Designed for AI agents with semantic action spaces
from notte_sdk import NotteClientfrom pydantic import BaseModelclient = NotteClient()class Product(BaseModel): name: str price: floatwith client.Session() as session: session.execute(type="goto", url="https://example.com/products") # AI understands the page obs = session.observe(instructions="Find the search box") action = obs.space.first() # AI picks the right element session.execute(action.with_value("laptops")) # Structured extraction with LLM products = session.scrape( response_format=list[Product], instructions="Extract all products with names and prices" ) # Every action is recorded replay = session.replay() replay.download("automation.mp4")
from notte_sdk import NotteClientclient = NotteClient()with client.Session() as session: # Use Notte for high-level navigation session.execute(type="goto", url="https://example.com") # Switch to Playwright for network control page = session.page page.route("**/api/*", lambda route: route.continue_(headers={ **route.request.headers, "Authorization": f"Bearer {token}" })) # Back to Notte for AI-powered scraping data = session.scrape(instructions="Extract all article titles")