Agent Skills
› rcarmo/piclaw
› playwright
playwright
GitHub指导在项目中安装和配置 Playwright,用于浏览器自动化及网页抓取。涵盖环境初始化、依赖安装、脚本编写与运行示例,以及调试技巧和缓存配置建议。
Trigger Scenarios
需要进行网页数据抓取
需要自动化浏览器操作或测试
询问如何安装和使用 Playwright
Install
npx skills add rcarmo/piclaw --skill playwright -g -y
SKILL.md
Frontmatter
{
"name": "playwright",
"description": "Use Playwright for browser automation in this workspace. Install locally and run scripts as needed.",
"distribution": "public"
}
Playwright
Use Playwright for browser automation and web scraping.
Steps
-
Ensure the project has a
package.json(create if missing):bun init -y -
If the project already has dependencies, install them:
bun install -
Install Playwright locally (per-project):
bun add -d playwright -
Install the browsers and OS deps (recommended in this container):
bunx playwright install --with-deps # or just chromium if you want lighter installs bunx playwright install chromium --with-deps -
Create a script (example):
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(); -
Run the script with Bun:
bun run scripts/playwright/example.ts
Tips
- For debugging, run with
headless: falseand addslowMo: 50. - If Playwright complains about missing dependencies, re-run:
bunx playwright install --with-deps - To keep browser binaries in the workspace, set:
export PLAYWRIGHT_BROWSERS_PATH=/workspace/.cache/ms-playwright
Version History
- 5fa0ce5 Current 2026-07-25 10:25


