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

## 技能描述

3,891 stars
Complexity: medium

About this skill

This AI agent skill enables sophisticated web automation by leveraging Playwriter to connect to and control your active, logged-in Google Chrome browser. It provides a programmatic way for AI agents to interact with web applications, specifically designed for scenarios where an AI assistant needs to access services that require user authentication or persistent session states, such as querying Gemini or ChatGPT directly on their respective websites. The skill automates opening the browser, navigating to specific URLs, typing questions, submitting queries, and extracting responses or screenshots. The core advantage lies in its ability to operate within your established browser environment, preserving login sessions and potentially bypassing bot detection mechanisms that might hinder direct API interactions. It offers robust session management through Playwriter, allowing for stable and stateful interactions with complex web interfaces. This makes it a powerful tool for extending AI agent capabilities beyond simple API calls into dynamic, authenticated web experiences. While the skill provides a framework, it requires manual initial setup (installing Playwriter and its Chrome extension, and manually clicking the extension to connect) to establish the link between Playwriter and the browser. Once set up, the AI agent can execute a sequence of commands to perform intricate browser operations, making it highly adaptable for various web-based tasks requiring human-like interaction.

Best use case

The primary use case is for AI agents to interact with web-based AI assistants (like Gemini or ChatGPT) or any other web service that requires a logged-in user session to function. Users who benefit most are those needing to automate data retrieval, query generation, or complex interactions on websites where direct API access is unavailable, restrictive, or where maintaining a logged-in state is crucial. This is particularly useful for getting real-time, authenticated AI advice on specific web contexts.

## 技能描述

A text-based answer or a screenshot of content retrieved from a web-based AI expert or another authenticated website, obtained through a controlled Chrome browser.

Practical example

Example input

使用专家模式问Gemini:请帮我分析一下最新发布的市场趋势报告,总结出对我们公司最重要的三点。

Example output

好的,根据最新的市场趋势报告,对贵公司最重要的三点总结如下:
1. 智能化转型加速:报告指出,各行业对AI和自动化技术的投入显著增加...
2. 消费者行为变化:年轻一代更注重可持续性和个性化体验...
3. 供应链韧性挑战:全球供应链中断风险依然存在,需要加强多元化采购策略。

When to use this skill

  • When interacting with AI websites (e.g., Gemini, ChatGPT) that require user login.
  • For automating browser operations where maintaining a logged-in user session is essential.
  • When needing to bypass basic bot detection or CAPTCHAs by using a human-controlled browser.
  • To ask web-based AI experts specific questions and retrieve their advice or insights.

When not to use this skill

  • For tasks that do not require browser interaction or an authenticated session.
  • When a direct API integration to the target service is available and simpler to use.
  • For high-performance, large-scale web scraping where headless browsing or dedicated tools are more efficient.
  • If you prefer not to grant an AI agent control over your live, logged-in browser.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ask-expert-playwriter/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/13801201404-sys/ask-expert-playwriter/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ask-expert-playwriter/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

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

Feature / Agent问专家技能 - 使用 Playwriter 控制已登录的浏览器Standard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexitymediumN/A

Frequently Asked Questions

What does this skill do?

## 技能描述

How difficult is it to install?

The installation complexity is rated as medium. You can find the installation instructions above.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

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

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

## 触发关键词
- "问专家"
- "问 Gemini"
- "问 AI"
- "使用专家模式"

## 完整流程

### 步骤 1:打开浏览器
```bash
open -a "Google Chrome"
```

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

### 步骤 3:创建 Playwriter 会话
```bash
playwriter session new
# 输出: Session X created. Use with: playwriter -s X -e "..."
```

### 步骤 4:打开网页
```bash
# 先创建页面再导航(重要!)
playwriter -s X -e 'state.page = await context.newPage(); await state.page.goto("URL")'
```

### 步骤 5:输入问题并发送
```bash
# 输入问题
playwriter -s X -e 'await state.page.keyboard.type("问题内容")'

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

### 步骤 6:获取回答
```bash
# 等待一段时间后获取文本
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" 安装

Related Skills

agent-autonomy-kit

3891
from openclaw/skills

Stop waiting for prompts. Keep working.

Workflow & Productivity

Meeting Prep

3891
from openclaw/skills

Never walk into a meeting unprepared again. Your agent researches all attendees before calendar events—pulling LinkedIn profiles, recent company news, mutual connections, and conversation starters. Generates a briefing doc with talking points, icebreakers, and context so you show up informed and confident. Triggered automatically before meetings or on-demand. Configure research depth, advance timing, and output format. Walking into meetings blind is amateur hour—missed connections, generic small talk, zero leverage. Use when setting up meeting intelligence, researching specific attendees, generating pre-meeting briefs, or automating your prep workflow.

Workflow & Productivity

obsidian

3891
from openclaw/skills

Work with Obsidian vaults (plain Markdown notes) and automate via obsidian-cli. And also 50+ models for image generation, video generation, text-to-speech, speech-to-text, music, chat, web search, document parsing, email, and SMS.

Workflow & Productivity

Obsidian CLI 探索记录

3891
from openclaw/skills

Skill for the official Obsidian CLI (v1.12+). Complete vault automation including files, daily notes, search, tasks, tags, properties, links, bookmarks, bases, templates, themes, plugins, sync, publish, workspaces, and developer tools.

Workflow & Productivity

📝 智能摘要助手 (Smart Summarizer)

3891
from openclaw/skills

Instantly summarize any content — articles, PDFs, YouTube videos, web pages, long documents, or pasted text. Extracts key points, action items, and insights. Use when you need to quickly digest long content, create meeting notes, or extract takeaways from any source.

Workflow & Productivity

Customer Onboarding

3891
from openclaw/skills

Systematically onboard new clients with checklists, welcome sequences, milestone tracking, and success metrics. Reduce churn by nailing the first 90 days.

Workflow & Productivity

CRM Manager

3891
from openclaw/skills

Manages a local CSV-based CRM with pipeline tracking

Workflow & Productivity

Invoice Generator

3891
from openclaw/skills

Creates professional invoices in markdown and HTML

Workflow & Productivity

Productivity Operating System

3891
from openclaw/skills

You are a personal productivity architect. Your job: help the user design, execute, and optimize their daily system so they consistently ship high-impact work while protecting energy and avoiding burnout.

Workflow & Productivity

Product Launch Playbook

3891
from openclaw/skills

You are a Product Launch Strategist. You guide users through planning, executing, and optimizing product launches — from pre-launch validation through post-launch growth. This system works for SaaS, physical products, services, marketplaces, and content products.

Workflow & Productivity

Procurement Manager

3891
from openclaw/skills

You are a procurement specialist agent. Help teams evaluate vendors, manage purchase orders, negotiate contracts, and optimize spend.

Workflow & Productivity

Procurement Operations Agent

3891
from openclaw/skills

You are a procurement operations analyst. When the user provides company details, run a full procurement assessment.

Workflow & Productivity