← 返回 Skills 市场
carpedx

Playwright 网页自动化工具

作者 carpe · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
110
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install playwright-web-test
功能描述
使用 Playwright 对本地网页、静态 HTML 或在线页面执行自动化测试、元素发现、控制台日志采集与截图。
使用说明 (SKILL.md)

Playwright Web Test

这是一个面向 ClawHub / OpenClaw 的网页自动化技能,适合以下场景:

  • 打开网页并截图
  • 自动发现按钮、链接、输入框等元素
  • 采集浏览器 console 日志
  • 测试本地静态 HTML 文件
  • 在启动本地服务后执行自动化脚本

推荐触发方式

你可以直接对 agent 说:

  • 打开 http://localhost:5173 并截图
  • 分析这个页面上有哪些按钮和输入框:http://localhost:3000
  • 访问 file:///tmp/demo.html,点击按钮后截图
  • 采集 http://localhost:5173 的 console 日志

目录说明

  • agents/main/agent.yaml:技能入口
  • scripts/run_task.py:统一执行入口
  • scripts/with_server.py:先启动服务再执行自动化
  • examples/:示例脚本

使用建议

  1. 动态页面先等待 networkidle
  2. 优先先做元素发现,再编写精确操作
  3. 需要启动本地服务时,优先使用 with_server.py
  4. 截图输出会使用 MEDIA: 规范,便于网关直接展示

注意事项

  • 需要本地 Python 环境可用
  • 首次运行前需安装 Playwright: python3 -m pip install playwright && python3 -m playwright install chromium
  • 如果目标页面依赖本地服务,请确认端口可访问
安全使用建议
This package is internally consistent for local/remote page automation, but take these precautions before installing or running it: - Install Playwright and Chromium via the recommended commands in a controlled environment (virtualenv or container). - Be careful when navigating untrusted remote pages: Playwright executes page JavaScript and allows network requests, so visiting unknown URLs can expose sensitive data or cause unexpected network activity. - The repository includes scripts/with_server.py which will run arbitrary shell commands (uses shell=True). Only use with_server.py with trusted commands and inputs; avoid passing untrusted strings to --server to prevent shell injection. - Outputs are written to /tmp by default; if those files may contain sensitive screenshots or logs, set OPENCLAW_OUTPUT_DIR to a secure location. - If you need tighter security, run the skill in an isolated environment (container, VM) and review any commands the agent will execute before allowing agent-driven automation.
能力评估
Purpose & Capability
Skill name/description align with code and instructions: it uses Python + Playwright to open URLs and file:// pages, take screenshots, discover elements, and capture console logs. Declared requirement (python3) matches. Included helper scripts (e.g., with_server.py) are coherent with the stated use case (start local services before automation).
Instruction Scope
Runtime instructions and run_task.py stay within the stated scope: they parse a URL or file:// path, open it in Playwright, capture screenshots/logs, and write outputs to an output directory. A notable implementation detail: scripts/with_server.py spawns arbitrary shell commands (subprocess.Popen(..., shell=True)) to start services and waits for ports — this is consistent with starting local dev servers but is a privileged operation if untrusted inputs are forwarded. The agent entrypoint runs scripts/run_task.py only, not with_server.py, so with_server.py is present but not invoked automatically by the agent entrypoint.
Install Mechanism
No automated install spec is included; SKILL.md instructs the user to pip install Playwright and run playwright install chromium. That manual instruction is expected and avoids the skill fetching arbitrary binaries itself.
Credentials
The skill requests no environment variables or credentials. It writes outputs to OPENCLAW_OUTPUT_DIR or /tmp by default. There are no requests for unrelated secrets or system config paths.
Persistence & Privilege
always is false and the skill does not attempt to modify other skills or system-wide agent configuration. It creates output files under /tmp or OPENCLAW_OUTPUT_DIR, which is appropriate for this functionality.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install playwright-web-test
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /playwright-web-test 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of playwright-web-test, enabling web automation and testing with Playwright. - Automate testing on local, static, or online web pages. - Discover and inspect UI elements like buttons and input fields. - Capture browser console logs and screenshots. - Supports both direct page access and scenarios requiring local server startup. - Provides clear instructions and script directory structure in SKILL.md.
元数据
Slug playwright-web-test
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Playwright 网页自动化工具 是什么?

使用 Playwright 对本地网页、静态 HTML 或在线页面执行自动化测试、元素发现、控制台日志采集与截图。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 110 次。

如何安装 Playwright 网页自动化工具?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install playwright-web-test」即可一键安装,无需额外配置。

Playwright 网页自动化工具 是免费的吗?

是的,Playwright 网页自动化工具 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Playwright 网页自动化工具 支持哪些平台?

Playwright 网页自动化工具 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Playwright 网页自动化工具?

由 carpe(@carpedx)开发并维护,当前版本 v1.0.0。

💬 留言讨论