Playwright connects to a Surfsky browser over the session’s CDP WebSocket URL instead of launching one itself. The browser runs in Surfsky’s cloud, so you do not need Chromium on your machine.
To have a coding agent set this up in your project, give it the setup prompt.
Playwright has known leaks that anti-bot scripts can detect. On sites with bot
protection, use a patched fork such as Patchright or rebrowser-playwright.
Use human-emulation commands for clicks, typing, and scrolling.
Keep Playwright for navigation, selectors, waiting, and page content.
Prerequisites
Set your API token and base URL. The examples use your account’s default proxy pool. Proxy, fingerprint, and other start options are in the API reference.
Run an example
The examples use a one-time profile. To reuse a saved login, pass a persistent profile UUID to the session call instead.
Python (async)
JavaScript
Java
.NET
Requires Python 3.12 or newer.Save as surfsky_playwright.py:Run it: Requires Node.js 24 or newer, or Bun, for await using.Save as surfsky-playwright.mjs:Run it: Add Playwright to your project using the official instructions. Start a browser with the REST quickstart and export the returned ws_url as SURFSKY_WS_URL. Start a browser with the REST quickstart and export the returned ws_url as SURFSKY_WS_URL. Put this in Program.cs:Run with dotnet run.
Expected output:
Prefer human emulation over Playwright’s own click, fill, and scroll. Human.* commands move the cursor and type with human timing, and they run through a page-level CDP session. Replace the selector with an input on your page:
Stop the session
Playwright’s browser.close() only disconnects from a browser attached over CDP. Without the SDK, stop it through CDP as the Java and .NET examples do. In async Python:
or through the API with the internal_uuid from the start response:
Otherwise the browser stops after the inactivity timeout.