playwright
2
总安装量
2
周安装量
#75368
全站排名
安装命令
npx skills add https://github.com/millionthodin16/clawd-explorations --skill playwright
Agent 安装分布
codex
2
claude-code
2
antigravity
2
gemini-cli
2
windsurf
1
opencode
1
Skill 文档
Playwright – Browser Automation
Browser automation using Playwright. Works on ARM64 with Firefox when Chrome isn’t available.
Setup
Playwright is already installed:
pip install playwright
python3 -m playwright install firefox # Already done
Commands
Basic Operations
uv run {baseDir}/scripts/cli.py navigate "https://example.com"
uv run {baseDir}/scripts/cli.py content "https://example.com"
uv run {baseDir}/scripts/cli.py title "https://example.com"
Screenshot
uv run {baseDir}/scripts/cli.py screenshot "https://example.com" --output /tmp/page.png
Interactive Actions
uv run {baseDir}/scripts/cli.py click "https://example.com" --selector ".button"
uv run {baseDir}/scripts/cli.py type "https://example.com" --selector "#input" --text "hello"
uv run {baseDir}/scripts/cli.py scroll "https://example.com" --direction down
Find Elements
uv run {baseDir}/scripts/cli.py find "https://example.com" --selector "a"
uv run {baseDir}/scripts/cli.py links "https://example.com"
Multi-step Tasks
uv run {baseDir}/scripts/cli.py task "
1. Go to https://example.com
2. Click the 'More' link
3. Extract the title
"
Full Page Snapshot
uv run {baseDir}/scripts/cli.py snapshot "https://example.com" --format ai
Examples
Research Task
# Get clean content from a page
uv run {baseDir}/scripts/cli.py content "https://github.com/MillionthOdin16/clawd-demo-site"
# Take a screenshot
uv run {baseDir}/scripts/cli.py screenshot "https://demo.bradarr.com" --output /tmp/demo.png
Automation Script
from playwright.async_api import async_playwright
import asyncio
async def run_task():
async with async_playwright() as p:
browser = await p.firefox.launch(headless=True)
page = await browser.new_page()
# Navigate
await page.goto("https://example.com")
# Interact
await page.click(".selector")
await page.fill("#input", "text")
# Extract
title = await page.title()
content = await page.content()
await browser.close()
return title, content
# Run the async function
asyncio.run(run_task())
Why Playwright Over Chrome?
| Feature | Playwright (Firefox) | Chrome CDP |
|---|---|---|
| ARM64 Support | â Yes | â No |
| Firefox | â Works | â Not supported |
| Chromium | â ï¸ Limited | â Full |
| Screenshots | â Yes | â Yes |
| Multi-browser | â 3 engines | Chrome only |
When to Use
| Task | Tool | Why |
|---|---|---|
| Simple content extraction | r.jina.ai (curl) | No browser needed, faster |
| Interactive/JavaScript pages | playwright | Renders JS, can click/type |
| Screenshots | playwright | Full page capture |
| Quick URL to markdown | r.jina.ai | curl https://r.jina.ai/http://url |
See Also
- Full workflow guide:
memory/WORKFLOW.md– Decision tree for when to use playwright vs r.jina.ai - Browser automation:
memory/BROWSER-AUTOMATION.md– Clawdbot browser vs browser-use vs playwright
Notes
- Uses Firefox by default (works on ARM64)
- Headless mode for server environments
- Install other browsers:
python3 -m playwright install chromium webkit - For complex tasks, create a Python script
Files
scripts/cli.py– Main CLI toolmemory/PLAYWRIGHT-TASKS.md– Task examples (create as needed)