Build browser automation and web scraping with Playwright on your local machine. Includes stealth mode for anti-bot bypass, authenticated sessions, infinite scroll handling, screenshot/PDF generation, and residential IP advantages. Use when: automating browsers, scraping protected sites, testing with real IPs, bypassing bot detection, generating screenshots/PDFs, or troubleshooting "target closed", "element not found", or "navigation timeout" errors.
View on GitHubSelect agents to install to:
npx add-skill https://github.com/jezweb/claude-skills/blob/main/skills/playwright-local/SKILL.md -a claude-code --skill playwright-localInstallation paths:
.claude/skills/playwright-local/# Playwright Local Browser Automation
**Status**: Production Ready ✅
**Last Updated**: 2026-01-10
**Dependencies**: Node.js 20+ (Node.js 18 deprecated) or Python 3.9+
**Latest Versions**: playwright@1.57.0, playwright-stealth@0.0.1, puppeteer-extra-plugin-stealth@2.11.2
**Browser Versions**: Chromium 143.0.7499.4 | Firefox 144.0.2 | WebKit 26.0
> **⚠️ v1.57 Breaking Change**: Playwright now uses [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) builds instead of Chromium. This provides more authentic browser behavior but changes the browser icon and title bar.
---
## Quick Start (5 Minutes)
### 1. Install Playwright
**Node.js**:
```bash
npm install -D playwright
npx playwright install chromium
```
**Python**:
```bash
pip install playwright
playwright install chromium
```
**Why this matters:**
- `playwright install` downloads browser binaries (~400MB for Chromium)
- Install only needed browsers: `chromium`, `firefox`, or `webkit`
- Binaries stored in `~/.cache/ms-playwright/`
### 2. Basic Page Scrape
```typescript
import { chromium } from 'playwright';
const browser = await chromium.launch({ headless: true });
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle' });
const title = await page.title();
const content = await page.textContent('body');
await browser.close();
console.log({ title, content });
```
**CRITICAL:**
- Always close browser with `await browser.close()` to avoid zombie processes
- Use `waitUntil: 'networkidle'` for dynamic content (SPAs)
- Default timeout is 30 seconds - adjust with `timeout: 60000` if needed
### 3. Test Locally
```bash
# Node.js
npx tsx scrape.ts
# Python
python scrape.py
```
---
## Why Playwright Local vs Cloudflare Browser Rendering
| Feature | Playwright Local | Cloudflare Browser Rendering |
|---------|------------------|------------------------------|
| **IP Address** | Residential (your ISP) | Datacenter (easily detected) |
| **Ste