browser
Control a Chromium browser via CDP. Use when automating web browsing, scraping pages, testing web apps, monitoring network traffic, or interacting with page elements.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Browser CLI Skill
Control a Chromium browser via CDP. Install: https://github.com/camhahu/browser
curl -fsSL https://raw.githubusercontent.com/camhahu/browser/main/packages/cli/install.sh | bash
Core Loop
browser open https://example.com # Starts headless browser, shows outline
browser click l3 # 1. Click by label from outline
browser text ".product-list" # 3. Read content
browser stop # Always stop when finished
Prefer text over screenshots. Text is faster and more reliable. Use screenshots only when visual layout matters.
Commands
# Navigation
browser open <url> # Open URL (auto-starts headless browser if needed)
browser navigate <url> # Navigate current tab
browser back / forward / refresh # History navigation
browser stop # Close browser
# Interaction
browser click <selector> # Click by label, text, or CSS
browser type <text> [selector] # Type into input (special keys: Enter, Escape, Tab)
browser hover <selector> # Move mouse to element
browser drag <source> <target> # Drag element to another element
browser select <selector> <value> # Select dropdown option
browser scroll <target> # Scroll to top, bottom, or selector
# Content
browser outline # Show outline again (or use -a for full structure)
browser text [selector] # Extract text content
browser screenshot [name] # Capture screenshot (use when layout matters)
# Tabs
browser tabs # List all open tabs
browser use <tab-id> # Switch to tab
browser close [tab-id] # Close tab
# Debugging
browser console # Show console output
browser network # List network requests
browser eval <js> # Run JavaScript (shares scope between calls)
Navigation commands (open, click, navigate, back, forward, refresh) show an outline after completing.
For debugging or user intervention, start a headed browser with browser start --headed.
Run browser --help for full command list.
Outline
Outline shows interactive elements with labels:
[l1] link "Products" [href=/products]
[l2] link "About" [href=/about]
[b3] button "Sign up"
[i4] input [type=email] [placeholder="Email"]
Selectors
browser click l3 # Label from outline (fastest)
browser click "Sign up" # Text match (exact first, then partial)
browser click ".btn-primary" # CSS selector
CSS selectors: #id, .class, tag, [attr=value], parent > child
Persistent Profile
Logins, cookies, and browsing data are preserved across sessions in ~/.browser/profile/.
browser config clear-profile # Logout, reset cookies
browser config set persistentProfile false # Disable persistence
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!