← Back to Notte

How do I connect Playwright or Puppeteer to a remote browser instance using CDP, instead of running Chrome locally?

Notte sessions expose a Chrome DevTools Protocol endpoint, so existing browser automation code can connect to a managed cloud browser instead of launching Chrome locally.

The migration is usually small:

  1. Create a Notte session.
  2. Read the session's CDP URL.
  3. Connect Playwright or Puppeteer to that URL.
  4. Keep the rest of your navigation, scraping, or testing logic mostly unchanged.

For Playwright, the shape is:

from notte_sdk import NotteClient
from playwright.sync_api import sync_playwright

client = NotteClient()

with client.Session(timeout_minutes=10) as session:
    cdp_url = session.cdp_url()

    with sync_playwright() as p:
        browser = p.chromium.connect_over_cdp(cdp_url)
        page = browser.new_page()
        page.goto("https://example.com")

For Puppeteer, the equivalent is:

import puppeteer from "puppeteer-core";

const browser = await puppeteer.connect({
  browserWSEndpoint: process.env.NOTTE_CDP_URL,
});

This is useful when you want cloud execution, session replay, profiles, proxies, or managed browser lifecycle without rewriting the automation framework you already use.