Playwright Skill
Remote browser automation via Playwright WebSocket server. No local browser installation required.
Use Cases
| Task | Script | Description |
|---|
| Screenshot | INLINECODE0 | Capture screenshots of web pages |
| PDF |
scripts/pdf-export.js | Generate PDFs from URLs |
| Test |
scripts/test-runner.js | Run Playwright tests remotely |
Installation
CODEBLOCK0
Quick Start
CODEBLOCK1
Configuration
Set PLAYWRIGHT_WS environment variable to your Playwright WebSocket URL:
CODEBLOCK2
Scripts
- -
screenshot.js - Take screenshots with options - INLINECODE5 - Generate PDFs
- INLINECODE6 - Run remote tests
References
- -
references/selectors.md - Selector strategies - INLINECODE8 - API documentation
Playwright 技能
通过 Playwright WebSocket 服务器实现远程浏览器自动化。无需本地安装浏览器。
使用场景
| 任务 | 脚本 | 描述 |
|---|
| 截图 | scripts/screenshot.js | 捕获网页截图 |
| PDF |
scripts/pdf-export.js | 从URL生成PDF |
| 测试 | scripts/test-runner.js | 远程运行Playwright测试 |
安装
bash
cd playwright-skill
npm install
export PLAYWRIGHT_WS=ws://your-server:3000
快速开始
bash
截图
node scripts/screenshot.js https://example.com screenshot.png --full-page
PDF
node scripts/pdf-export.js https://example.com page.pdf
配置
将 PLAYWRIGHT_WS 环境变量设置为您的 Playwright WebSocket URL:
bash
export PLAYWRIGHT_WS=ws://your-playwright-server:3000
脚本
- - screenshot.js - 带选项的截图功能
- pdf-export.js - 生成PDF
- test-runner.js - 运行远程测试
参考文档
- - references/selectors.md - 选择器策略
- references/api-reference.md - API文档