问专家 - Playwriter模式

# 问专家技能 - 使用 Playwriter 控制已登录的浏览器

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "问专家 - Playwriter模式" with this command: npx skills add 13801201404-sys/ask-expert-playwriter

问专家技能 - 使用 Playwriter 控制已登录的浏览器

技能描述

使用 Playwriter 连接用户已登录的 Chrome 浏览器,通过 Gemini 等 AI 助手获取专业建议。

触发关键词

  • "问专家"
  • "问 Gemini"
  • "问 AI"
  • "使用专家模式"

完整流程

步骤 1:打开浏览器

open -a "Google Chrome"

步骤 2:移动鼠标并点击扩展图标

# 移动鼠标到扩展图标位置 (1294, 86),等待 5 秒,点击
python3 -c "
import pyautogui
import time
pyautogui.moveTo(1294, 86)
time.sleep(5)
pyautogui.click()
"

步骤 3:创建 Playwriter 会话

playwriter session new
# 输出: Session X created. Use with: playwriter -s X -e "..."

步骤 4:打开网页

# 先创建页面再导航(重要!)
playwriter -s X -e 'state.page = await context.newPage(); await state.page.goto("URL")'

步骤 5:输入问题并发送

# 输入问题
playwriter -s X -e 'await state.page.keyboard.type("问题内容")'

# 发送
playwriter -s X -e 'await state.page.keyboard.press("Enter")'

步骤 6:获取回答

# 等待一段时间后获取文本
sleep 15
playwriter -s X -e 'const text = await state.page.locator("message-content").last().textContent(); console.log(text)'

# 或截图
playwriter -s X -e 'await state.page.screenshot({ path: "path/to/screenshot.png" })'

常见问题

Q: 扩展未连接

A: 需要用户手动点击 Chrome 右上角的 Playwriter 扩展图标,确保显示连接状态

Q: page undefined 错误

A: 需要先创建页面:state.page = await context.newPage()

Q: 连接断开

A: 使用 playwriter session reset <id> 重置会话,然后重新创建

适用场景

  • 需要登录账号才能使用的 AI 网站(Gemini、ChatGPT 等)
  • 需要保持登录状态的浏览器操作
  • 需要绕过机器人检测的场景
  • 询问专业问题获取 AI 建议

技术优势

  • 使用用户已登录的浏览器,无需重新登录
  • 通过 Chrome 扩展连接,安全稳定
  • 支持会话管理,可以保持状态

安装前置条件

  1. 安装 Playwriter:npm install -g playwriter@latest
  2. Chrome 安装 Playwriter 扩展:
    • 扩展 ID: jfeammnjpkecdekppnclgkkffahnhfhe
    • 或从 Chrome 网上应用店搜索 "Playwriter" 安装

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated