用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Demerzels-lab/elsamultiskillagent --skill browserbase-browser-automation命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | browserbase-browser-automation |
| description | Automate web browser interactions using the stagehand CLI for AI agents |
Automate web browser interactions using the stagehand CLI for AI agents.
🚨 CRITICAL - READ THIS FIRST 🚨
A Browserbase session with stealth/proxy/captcha has been pre-created for you.
YOU MUST USE stagehand --ws $BROWSERBASE_CONNECT_URL FOR EVERY COMMAND.
DO NOT use stagehand open without --ws - it will launch a LOCAL browser!
Use this skill when the user asks to:
The stagehand CLI provides:
@0-5 for easy clicking/filling--wsCRITICAL: A Browserbase session with stealth/proxy/captcha has been pre-created for you.
The session URL is in the BROWSERBASE_CONNECT_URL environment variable.
YOU MUST ALWAYS use stagehand --ws $BROWSERBASE_CONNECT_URL for EVERY command:
stagehand --ws $BROWSERBASE_CONNECT_URL open https://example.com
WHY:
IF YOU FORGET --ws $BROWSERBASE_CONNECT_URL:
# 1. Navigate to page (connects to pre-created Browserbase session)
stagehand --ws $BROWSERBASE_CONNECT_URL open https://example.com
# 2. Get page structure with element refs
stagehand --ws $BROWSERBASE_CONNECT_URL snapshot -c
# Output includes refs like [0-5], [1-2]:
# RootWebArea "Example" url="https://example.com"
# [0-0] link "Home"
# [0-1] link "About"
# [0-2] button "Sign In"
# 3. Interact using refs
stagehand --ws $BROWSERBASE_CONNECT_URL click @0-2
stagehand --ws $BROWSERBASE_CONNECT_URL fill @0-5 "search query"
# 4. Re-snapshot to verify changes
stagehand --ws $BROWSERBASE_CONNECT_URL snapshot -c
# 5. Stop when done (optional, session persists)
stagehand --ws $BROWSERBASE_CONNECT_URL stop
REMEMBER: Use stagehand --ws $BROWSERBASE_CONNECT_URL for ALL commands below.
# Navigate to URL
stagehand --ws $BROWSERBASE_CONNECT_URL open <url>
# With custom timeout for slow pages
stagehand --ws $BROWSERBASE_CONNECT_URL open <url> --timeout 60000
# Page navigation
stagehand --ws $BROWSERBASE_CONNECT_URL reload
stagehand --ws $BROWSERBASE_CONNECT_URL back
stagehand --ws $BROWSERBASE_CONNECT_URL forward
# Get accessibility tree with element refs
stagehand --ws $BROWSERBASE_CONNECT_URL snapshot -c
# Get full snapshot with XPath/CSS mappings
stagehand --ws $BROWSERBASE_CONNECT_URL snapshot --json
# Click by ref (from snapshot)
stagehand --ws $BROWSERBASE_CONNECT_URL click @0-5
stagehand --ws $BROWSERBASE_CONNECT_URL click 0-5 # @ prefix optional
# Click with options
stagehand --ws $BROWSERBASE_CONNECT_URL click @0-5 -b right -c 2 # Right-click twice
# Click at coordinates
stagehand --ws $BROWSERBASE_CONNECT_URL click_xy 100 200
# Fill input (auto-presses Enter by default)
stagehand --ws $BROWSERBASE_CONNECT_URL fill @0-5 "my value"
# Fill without pressing Enter
stagehand --ws $BROWSERBASE_CONNECT_URL fill @0-5 "my value" --no-press-enter
# Select dropdown options
stagehand --ws $BROWSERBASE_CONNECT_URL select @0-8 "Option 1" "Option 2"
# Type text naturally
stagehand --ws $BROWSERBASE_CONNECT_URL type "Hello, world!"
# Type with delay between characters
stagehand --ws $BROWSERBASE_CONNECT_URL type "slow typing" -d 100
# Press special keys
stagehand --ws $BROWSERBASE_CONNECT_URL press Enter
stagehand --ws $BROWSERBASE_CONNECT_URL press Tab
stagehand --ws $BROWSERBASE_CONNECT_URL press "Cmd+A"
# Get page info
stagehand --ws $BROWSERBASE_CONNECT_URL get url
stagehand --ws $BROWSERBASE_CONNECT_URL get title
stagehand --ws $BROWSERBASE_CONNECT_URL get text body
stagehand --ws $BROWSERBASE_CONNECT_URL get html @0-5
# Take screenshot
stagehand --ws $BROWSERBASE_CONNECT_URL screenshot page.png
stagehand --ws $BROWSERBASE_CONNECT_URL screenshot -f # Full page
stagehand --ws $BROWSERBASE_CONNECT_URL screenshot --type jpeg
# Get element coordinates
stagehand --ws $BROWSERBASE_CONNECT_URL get box @0-5 # Returns center x,y
# Wait for page load
stagehand --ws $BROWSERBASE_CONNECT_URL wait load
stagehand --ws $BROWSERBASE_CONNECT_URL wait load networkidle
# Wait for element
stagehand --ws $BROWSERBASE_CONNECT_URL wait selector ".my-class"
stagehand --ws $BROWSERBASE_CONNECT_URL wait selector ".my-class" -t 10000 -s visible
# Wait for time
stagehand --ws $BROWSERBASE_CONNECT_URL wait timeout 2000
# List all tabs
stagehand --ws $BROWSERBASE_CONNECT_URL pages
# Open new tab
stagehand --ws $BROWSERBASE_CONNECT_URL newpage https://example.com
# Switch tabs
stagehand --ws $BROWSERBASE_CONNECT_URL tab_switch 1
# Close tab
stagehand --ws $BROWSERBASE_CONNECT_URL tab_close 2
Capture HTTP requests for inspection:
# Start capturing
stagehand --ws $BROWSERBASE_CONNECT_URL network on
# Get capture directory
stagehand --ws $BROWSERBASE_CONNECT_URL network path
# Stop capturing
stagehand --ws $BROWSERBASE_CONNECT_URL network off
# Clear captures
stagehand --ws $BROWSERBASE_CONNECT_URL network clear
Captured requests are saved as directories with request.json and response.json.
# Check status
stagehand --ws $BROWSERBASE_CONNECT_URL status
# Stop browser
stagehand --ws $BROWSERBASE_CONNECT_URL stop
# Force stop
stagehand --ws $BROWSERBASE_CONNECT_URL stop --force
After snapshot, elements have refs you can use:
RootWebArea "Login Page"
[0-0] heading "Welcome"
[0-1] textbox "Email" name="email"
[0-2] textbox "Password" name="password"
[0-3] button "Sign In"
Use these refs directly:
stagehand --ws $BROWSERBASE_CONNECT_URL fill @0-1 "user@example.com"
stagehand --ws $BROWSERBASE_CONNECT_URL fill @0-2 "mypassword"
stagehand --ws $BROWSERBASE_CONNECT_URL click @0-3
stagehand --ws $BROWSERBASE_CONNECT_URL open https://example.com
stagehand --ws $BROWSERBASE_CONNECT_URL snapshot -c # Get refs
stagehand --ws $BROWSERBASE_CONNECT_URL click @0-5
stagehand --ws $BROWSERBASE_CONNECT_URL snapshot -c # Get new state
# ✅ Good: Use refs from snapshot
stagehand --ws $BROWSERBASE_CONNECT_URL click @0-5
# ❌ Avoid: Manual selectors (refs are more reliable)
stagehand --ws $BROWSERBASE_CONNECT_URL click "#submit-button"
stagehand --ws $BROWSERBASE_CONNECT_URL open https://slow-site.com
stagehand --ws $BROWSERBASE_CONNECT_URL wait selector ".content" -s visible
stagehand --ws $BROWSERBASE_CONNECT_URL snapshot -c
# ✅ Correct: Remote browser (connects to pre-created Browserbase session)
stagehand --ws $BROWSERBASE_CONNECT_URL open https://example.com
# ❌ Wrong: Local browser (will fail in evals, launches Chrome locally)
stagehand open https://example.com
stagehand --ws $BROWSERBASE_CONNECT_URL open https://example.com/login
stagehand --ws $BROWSERBASE_CONNECT_URL snapshot -c
# [0-5] textbox "Email"
# [0-6] textbox "Password"
# [0-7] button "Sign In"
stagehand --ws $BROWSERBASE_CONNECT_URL fill @0-5 "user@example.com"
stagehand --ws $BROWSERBASE_CONNECT_URL fill @0-6 "password123"
stagehand --ws $BROWSERBASE_CONNECT_URL click @0-7
stagehand --ws $BROWSERBASE_CONNECT_URL wait load
stagehand --ws $BROWSERBASE_CONNECT_URL snapshot -c # Verify logged in
stagehand --ws $BROWSERBASE_CONNECT_URL open https://example.com
stagehand --ws $BROWSERBASE_CONNECT_URL snapshot -c
# [0-3] textbox "Search"
stagehand --ws $BROWSERBASE_CONNECT_URL fill @0-3 "my query"
stagehand --ws $BROWSERBASE_CONNECT_URL wait selector ".results"
stagehand --ws $BROWSERBASE_CONNECT_URL snapshot -c
# [1-0] text "Result 1"
# [1-1] text "Result 2"
stagehand --ws $BROWSERBASE_CONNECT_URL get text @1-0
stagehand --ws $BROWSERBASE_CONNECT_URL get text @1-1
stagehand --ws $BROWSERBASE_CONNECT_URL open https://example.com
stagehand --ws $BROWSERBASE_CONNECT_URL snapshot -c
# [0-5] link "Next Page"
stagehand --ws $BROWSERBASE_CONNECT_URL click @0-5
stagehand --ws $BROWSERBASE_CONNECT_URL wait load
stagehand --ws $BROWSERBASE_CONNECT_URL snapshot -c # Get new page structure
stagehand is installed: which stagehandstagehand --ws $BROWSERBASE_CONNECT_URL statusstagehand --ws $BROWSERBASE_CONNECT_URL stopstagehand --ws $BROWSERBASE_CONNECT_URL snapshot -cstagehand --ws $BROWSERBASE_CONNECT_URL wait selector ...stagehand --ws $BROWSERBASE_CONNECT_URL open <url> --timeout 60000stagehand --ws $BROWSERBASE_CONNECT_URL wait load networkidlestagehand --ws $BROWSERBASE_CONNECT_URL stop --force && stagehand --ws $BROWSERBASE_CONNECT_URL open <url>-c) for faster parsing--session flag or BROWSE_SESSION env var