Playwright

From rcarmo/piclaw · View interactive version

Playwright is an AI agent skill from the GitHub repository rcarmo/piclaw. Use Playwright for browser automation in this workspace. Install locally and run scripts as needed.

How to use this skill

Skill file

Playwright

Use Playwright for browser automation and web scraping.

Steps

  1. Ensure the project has a package.json (create if missing):

```bash

bun init -y

```

  1. If the project already has dependencies, install them:

```bash

bun install

```

  1. Install Playwright locally (per-project):

```bash

bun add -d playwright

```

  1. Install the browsers and OS deps (recommended in this container):

```bash

bunx playwright install --with-deps

# or just chromium if you want lighter installs

bunx playwright install chromium --with-deps

```

  1. Create a script (example):

```ts

import { chromium } from "playwright";

const browser = await chromium.launch({ headless: true });

const page = await browser.newPage();

await page.goto("https://example.com", { waitUntil: "domcontentloaded" });

const title = await page.title();

console.log(title);

await browser.close();

```

  1. Run the script with Bun:

```bash

bun run scripts/playwright/example.ts

```

Tips

```bash

bunx playwright install --with-deps

```

```bash

export PLAYWRIGHT_BROWSERS_PATH=/workspace/.cache/ms-playwright

```

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.