Playwriter

作者 remorses525732a474a1无许可证3.9K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库昨天更新

Control the user own Chrome browser via Playwriter extension with Playwright code snippets in a stateful local js sandbox. Use this over other Playwright MCPs to automate the browser — it connects to the user's existing Chrome instead of launching a new one. Use this cli for navigating JS-heavy websites (Instagram, Twitter, cookie/login walls, lazy-loaded UIs) instead of webfetch/curl. ALWAYS load this skill before using any playwriter commands

AI 生成的概览

通过 Playwriter 扩展在本地 JS 沙箱中运行 Playwright 代码片段,控制用户已有的 Chrome 浏览器。

功能
该技能指导智能体通过 Playwriter 扩展操作用户自己的 Chrome 浏览器,在有状态的本地 JavaScript 沙箱中执行 Playwright 代码片段。内容涵盖会话创建、页面导航以及与 JavaScript 密集型页面的交互,并要求智能体在每个会话首次执行命令前完整阅读 playwriter 文档。其产出是浏览器自动化操作与页面状态,而非文件。
适用场景
适用于在用户现有 Chrome 会话中自动化浏览,尤其是 JavaScript 密集型网站、Cookie 或登录墙以及懒加载界面,这些场景下普通抓取或 curl 会失败。它也被定位为其他会启动新浏览器的 Playwright MCP 的替代方案。
运行要求
需要在用户 Chrome 中安装 Playwriter 浏览器扩展,并具备 playwriter CLI(或 npx/bunx playwriter@latest)、本地 JavaScript 沙箱以及对目标站点的网络访问。该技能不附带脚本,仅为说明文档。

Read Full Documentation (once per session)

Before the first playwriter command in a session, run:

bash
playwriter skill # IMPORTANT! do not use | head here. read in full!

This outputs the complete documentation including:

  • Session management and timeout configuration
  • Selector strategies (and which ones to AVOID)
  • Rules to prevent timeouts and failures
  • Best practices for slow pages and SPAs
  • Context variables, utility functions, and more

Do NOT skip this step. The examples below will fail without understanding timeouts, selector rules, and pitfalls from the full docs. You only need to do this once per session; subsequent playwriter commands in the same session do not require re-reading.

Read the ENTIRE output. Do NOT pipe through head, tail, or any truncation command. Critical rules are spread throughout the document, not just at the top.

Minimal Example (after reading full docs)

bash
playwriter session newplaywriter -s 1 -e 'state.page = await context.newPage(); await state.page.goto("https://example.com")'

Always use single quotes for the -e argument. Single quotes prevent bash from interpreting $, backticks, and backslashes inside your JS code. Use double quotes or backtick template literals for strings inside the JS.

If playwriter is not found, use npx playwriter@latest or bunx playwriter@latest.

来源与署名

来源:remorses/playwriter位于skills/playwriter提交525732a

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架