# Playwright
URL: /integrations/playwright

---
title: Playwright
sidebarTitle: Playwright
description: Drive a Steel cloud browser from Playwright over CDP in TypeScript or Python.
llm: true
---

Playwright is Microsoft's cross-browser automation library. The Steel integration attaches Playwright to a Steel cloud session over the Chrome DevTools Protocol, so the rest of your script — `page.goto`, locators, `expect`, tracing — drives a remote browser with stealth, proxies, and a live viewer instead of a local Chromium.

No `playwright install`, no headful display, no Chrome on your machine.

### Requirements

*   **Steel API Key**: Active Steel subscription
*   **Runtime**: Node.js 20+ or Python 3.10+
*   **Package**: `playwright` (TypeScript) or `playwright` (Python)

### Connect Steel to Playwright

Pass Steel's CDP URL into `chromium.connectOverCDP()`. Steel returns a context with a page already open, so reuse `browser.contexts()[0]` instead of creating a new one:

```typescript Typescript -wc
import { chromium } from "playwright";
import Steel from "steel-sdk";

const client = new Steel({ steelAPIKey: STEEL_API_KEY });
const session = await client.sessions.create();

const browser = await chromium.connectOverCDP(
  `${session.websocketUrl}&apiKey=${STEEL_API_KEY}`,
);
const page = browser.contexts()[0].pages()[0];
```

```python Python -wc
from playwright.sync_api import sync_playwright
from steel import Steel

client = Steel(steel_api_key=STEEL_API_KEY)
session = client.sessions.create()

playwright = sync_playwright().start()
browser = playwright.chromium.connect_over_cdp(
    f"{session.websocket_url}&apiKey={STEEL_API_KEY}"
)
page = browser.contexts[0].new_page()
```

Full runnable starter: [Steel + Playwright recipe →](/cookbook/playwright)

### FAQ

### Do I need to change my existing Playwright code to use Steel?

No — swap your local launch for `chromium.connectOverCDP()` (or `connect_over_cdp` in Python) pointed at the Steel session's `websocketUrl`. The rest of your script — `page.goto`, locators, `expect`, tracing — runs unchanged against the remote browser.

### How do I connect Playwright to a Steel browser session?

Create a session with `client.sessions.create()`, then connect with `chromium.connectOverCDP()` in Node or `playwright.chromium.connect_over_cdp()` in Python, passing the session's `websocketUrl` with your `apiKey` appended as a query parameter.

### Does Playwright work with Steel's proxies, stealth mode, and CAPTCHA solving?

Yes — those are options on `sessions.create()` (e.g. `useProxy`, `solveCaptcha`, `stealthConfig`), not Playwright settings. Playwright just sees a normal CDP browser; stealth, proxies, and the live viewer come from the Steel session.

### Do I still need to run `playwright install` or have Chrome installed locally?

No — the browser runs in Steel's cloud, so there's no `playwright install`, no headful display, and no Chrome on your machine. You only need the `playwright` package and a Steel API key.


### Resources

*   [Playwright documentation](https://playwright.dev) – Official Playwright docs for TypeScript and Python
*   [Steel Sessions API reference](/api-reference#tag/sessions) – Technical details for managing Steel browser sessions
*   [Steel Discord](https://discord.gg/steel-dev) – Get help and share what you build
