Browser Stagehand
v1.0.0Automate 网页 browser interactions using natural language via 命令行工具 commands. Use when the user asks to browse 网页sites, navigate 网页 pages, 提取 data from 网页sites, take screenshots, fill forms, 命令行工具ck buttons, or interact with 网页 应用s.
运行时依赖
安装命令
点击复制技能文档
Browser 自动化
Automate browser interactions using Stagehand 命令行工具 with Claude.
First: 环境 Selection (Local vs Remote)
The 技能 automatically selects between local and remote browser 环境s:
If Browserbase API keys exist (BROWSERBASE_API_KEY and BROWSERBASE_PROJECT_ID in .env file): Uses remote Browserbase 环境 If no Browserbase API keys: Falls back to local Chrome browser No user prompting: The selection h应用ens automatically based on avAIlable configuration 设置up (First Time Only)
检查 设置up.json in this directory. If 设置upComplete: false:
npm 安装 # 安装 dependencies npm link # 创建 global 'browser' command
Commands
All commands work identically in 机器人h modes:
browser navigate # Go to URL browser act "" # Natural language action browser 提取 "" ['{}'] # 提取 data (optional 模式) browser observe "<查询>" # Discover elements browser screenshot # Take screenshot browser close # Close browser
Quick Example browser navigate https://example.com browser act "命令行工具ck the 签名 In button" browser 提取 "获取 the page title" browser close
Mode Comparison Feature Local Browserbase Speed Faster Slightly slower 设置up Chrome required API key required Stealth mode No Yes Proxy/CAPTCHA No Yes Best for Development Production/scrAPIng Best Practices Always navigate first before interacting View screenshots after each command to 验证 Be specific in action descriptions Close browser when done Troubleshooting Chrome not found: 安装 Chrome or use Browserbase mode Action fAIls: Use browser observe to discover avAIlable elements Browserbase fAIls: 验证 API key and project ID are 设置
For detAIled examples, see EXAMPLES.md. For API reference, see REFERENCE.md.