跳到正文
Skillpedia
自动化102k · #828

browser

它能做什么

这个技能让 AI 控制网页浏览器,打开页面、阅读内容并填写表单。适合希望自动化重复性网页任务的人。

适用场景

  • ✓当你需要 AI 打开某个网站并从中提取信息的时候。
  • ✓当你希望自动填写并提交网页表单的时候。
  • ✓当你需要一张网页截图用于审阅的时候。

技能链接

https://github.com/ruvnet/RuView/blob/main/.claude/skills/browser/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/ruvnet/RuView/blob/main/.claude/skills/browser/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我打开供应商的网站,找到当前的价格表,并告诉我有哪些变化。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 获取页面可交互部分的简短地图,每项都有一个引用,然后使用这些引用进行点击或输入。每次改动之后,它都会重新获取一份新快照。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Browser Automation Skill

Web browser automation using agent-browser with AI-optimized snapshots. Reduces context by 93% using element refs (@e1, @e2) instead of full DOM.

Core Workflow

# 1. Navigate to page
agent-browser open <url>

# 2. Get accessibility tree with element refs
agent-browser snapshot -i    # -i = interactive elements only

# 3. Interact using refs from snapshot
agent-browser click @e2
agent-browser fill @e3 "text"

# 4. Re-snapshot after page changes
agent-browser snapshot -i

Quick Reference

Navigation

Command Description
open <url> Navigate to URL
back Go back
forward Go forward
reload Reload page
close Close browser

Snapshots (AI-Optimized)

Command Description
snapshot Full accessibility tree
snapshot -i Interactive elements only (buttons, links, inputs)
snapshot -c Compact (remove empty elements)
snapshot -d 3 Limit depth to 3 levels
screenshot [path] Capture screenshot (base64 if no path)

Interaction

Command Description
click <sel> Click element
fill <sel> <text> Clear and fill input
type <sel> <text> Type with key events
press <key> Press key (Enter, Tab, etc.)
hover <sel> Hover element
select <sel> <val> Select dropdown option
check/uncheck <sel> Toggle checkbox
scroll <dir> [px] Scroll page

Get Info

Command Description
get text <sel> Get text content
get html <sel> Get innerHTML
get value <sel> Get input value
get attr <sel> <attr> Get attribute
get title Get page title
get url Get current URL

Wait

Command Description
wait <selector> Wait for element
wait <ms> Wait milliseconds
wait --text "text" Wait for text
wait --url "pattern" Wait for URL
wait --load networkidle Wait for load state

Sessions

Command Description
--session <name> Use isolated session
session list List active sessions

Selectors

Element Refs (Recommended)

# Get refs from snapshot
agent-browser snapshot -i
# Output: button "Submit" [ref=e2]

# Use ref to interact
agent-browser click @e2

CSS Selectors

agent-browser click "#submit"
agent-browser fill ".email-input" "test@test.com"

Semantic Locators

agent-browser find role button click --name "Submit"
agent-browser find label "Email" fill "test@test.com"
agent-browser find testid "login-btn" click

Examples

Login Flow

agent-browser open https://example.com/login
agent-browser snapshot -i
agent-browser fill @e2 "user@example.com"
agent-browser fill @e3 "password123"
agent-browser click @e4
agent-browser wait --url "**/dashboard"

Form Submission

agent-browser open https://example.com/contact
agent-browser snapshot -i
agent-browser fill @e1 "John Doe"
agent-browser fill @e2 "john@example.com"
agent-browser fill @e3 "Hello, this is my message"
agent-browser click @e4
agent-browser wait --text "Thank you"

Data Extraction

agent-browser open https://example.com/products
agent-browser snapshot -i
# Iterate through product refs
agent-browser get text @e1  # Product name
agent-browser get text @e2  # Price
agent-browser get attr @e3 href  # Link

Multi-Session (Swarm)

# Session 1: Navigator
agent-browser --session nav open https://example.com
agent-browser --session nav state save auth.json

# Session 2: Scraper (uses same auth)
agent-browser --session scrape state load auth.json
agent-browser --session scrape open https://example.com/data
agent-browser --session scrape snapshot -i

Integration with Claude Flow

MCP Tools

All browser operations are available as MCP tools with browser/ prefix:

  • browser/open
  • browser/snapshot
  • browser/click
  • browser/fill
  • browser/screenshot
  • etc.

Memory Integration

# Store successful patterns
npx @claude-flow/cli memory store --namespace browser-patterns --key "login-flow" --value "snapshot->fill->click->wait"

# Retrieve before similar task
npx @claude-flow/cli memory search --query "login automation"

Hooks

# Pre-browse hook (get context)
npx @claude-flow/cli hooks pre-edit --file "browser-task.ts
常见问题

AI 在页面上看到的是什么?

一份紧凑的按钮、链接和输入框列表,而不是完整的页面代码。

它能截图吗?

能。该技能包含截图命令。

使用前需要准备什么?

必须先安装 agent-browser 工具,因为该技能要运行它的命令。

详情

作者的原始描述

Web browser automation with AI-optimized snapshots for claude-flow agents

repo: ruvnet/RuView

热度

GitHub 星标
102k
排名
#828
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能