Skip to main content
Playwright attaches to a Surfsky browser through the session’s CDP WebSocket URL. Use connect_over_cdp in Python or connectOverCDP in the other languages instead of launching a browser. The browser runs in Surfsky’s cloud; no local Chromium is needed.
Standard Playwright creates utility worlds, helper scripts, and bindings that detection scripts can identify. Use a patched fork such as Patchright or rebrowser-playwright for sites with bot protection.

Prerequisites

Set your API token and base URL. The examples start a browser with an empty request body, which uses your account’s default proxy pool. Proxy, fingerprint, and other start options are in the API reference.

Run an example

Each example starts a one-time browser, connects, opens a page, prints its title, and closes the browser. To keep cookies and login state between runs, start a persistent profile instead; the connection code is the same.
Save as surfsky_playwright.py:
Expected output:

Stop the session

Playwright’s browser.close() only disconnects from a browser attached over CDP. Stop the session either through CDP, as the examples do:
or through the API with the internal_uuid from the start response:
Otherwise the browser stops after the inactivity timeout, 30 seconds by default.