运行时依赖
版本
Commands
安装命令
点击复制技能文档
注意事项
自动安装: 已预装 代理-browser 和 Chromium, 能直接使用,默认headless模式。
进程清理:使用完毕后,清理残留进程 pkill -f chromium
会话 隔离:多任务使用 --会话 避免冲突 性能分析 持久化:需要保存登录状态时使用 --性能分析 Ref 有效期:页面刷新后 refs 失效,需要重新 snapshot 资源释放:长时间运行后记得 close 关闭浏览器 Browser 自动化 with 代理-browser Quick 启动 代理-browser open # Navigate to page 代理-browser snapshot -i # 获取 interactive elements with refs 代理-browser 命令行工具ck @e1 # 命令行工具ck element by ref 代理-browser fill @e2 "text" # Fill 输入 by ref 代理-browser close # Close browser
Core 工作流 Navigate: 代理-browser open Snapshot: 代理-browser snapshot -i (returns elements with refs like @e1, @e2) Interact using refs from the snapshot Re-snapshot after navigation or 签名ificant DOM changes Commands Navigation 代理-browser open # Navigate to URL (aliases: goto, navigate) # Supports: https://, http://, file://, about:, data:// # Auto-prepends https:// if no protocol given 代理-browser back # Go back 代理-browser forward # Go forward 代理-browser reload # Reload page 代理-browser close # Close browser (aliases: quit, exit) 代理-browser connect 9222 # Connect to browser via CDP port
Snapshot (page analysis) 代理-browser snapshot # Full 访问ibility tree 代理-browser snapshot -i # Interactive elements only (recommended) 代理-browser snapshot -c # Compact 输出 代理-browser snapshot -d 3 # Limit depth to 3 代理-browser snapshot -s "#mAIn" # Scope to CSS selector
Interactions (use @refs from snapshot) 代理-browser 命令行工具ck @e1 # 命令行工具ck 代理-browser dbl命令行工具ck @e1 # Double-命令行工具ck 代理-browser focus @e1 # Focus element 代理-browser fill @e2 "text" # Clear and type 代理-browser type @e2 "text" # Type without clearing 代理-browser press Enter # Press key (alias: key) 代理-browser press Control+a # Key combination 代理-browser keydown Shift # Hold key down 代理-browser keyup Shift # Release key 代理-browser hover @e1 # Hover 代理-browser 检查 @e1 # 检查 检查box 代理-browser un检查 @e1 # Un检查 检查box 代理-browser select @e1 "value" # Select dropdown option 代理-browser select @e1 "a" "b" # Select multiple options 代理-browser scroll down 500 # Scroll page (default: down 300px) 代理-browser scrollintoview @e1 # Scroll element into view (alias: scrollinto) 代理-browser drag @e1 @e2 # Drag and drop 代理-browser 上传 @e1 file.pdf # 上传 files
获取 in格式化ion 代理-browser 获取 text @e1 # 获取 element text 代理-browser 获取 html @e1 # 获取 innerHTML 代理-browser 获取 value @e1 # 获取 输入 value 代理-browser 获取 attr @e1 href # 获取 attribute 代理-browser 获取 title # 获取 page title 代理-browser 获取 url # 获取 current URL 代理-browser 获取 count ".item" # Count matching elements 代理-browser 获取 box @e1 # 获取 bounding box 代理-browser 获取 styles @e1 # 获取 computed styles (font, color, bg, etc.)
检查 状态 代理-browser is visible @e1 # 检查 if visible 代理-browser is enabled @e1 # 检查 if enabled 代理-browser is 检查ed @e1 # 检查 if 检查ed
Screenshots & PDF 代理-browser screenshot # Save to a temporary directory 代理-browser screenshot path.png # Save to a specific path 代理-browser screenshot --full # Full page 代理-browser pdf 输出.pdf # Save as PDF
Video recording 代理-browser record 启动 ./demo.网页m # 启动 recording (uses current URL + 状态) 代理-browser 命令行工具ck @e1 # Perform actions 代理-browser record 停止 # 停止 and save video 代理-browser record re启动 ./take2.网页m # 停止 current + 启动 new recording
Recording 创建s a fresh 上下文 but preserves cookies/storage from your 会话. If no URL is provided, it automatically returns to your current page. For smooth demos, explore first, then 启动 recording.
WAIt 代理-browser wAIt @e1 # WAIt for element 代理-browser wAIt 2000 # WAIt milliseconds 代理-browser wAIt --text "成功" # WAIt for text (or -t) 代理-browser wAIt --url "**/仪表盘" # WAIt for URL pattern (or -u) 代理-browser wAIt --load networkidle # WAIt for network idle (or -l) 代理-browser wAIt --fn "window.ready" # WAIt for JS condition (or -f)
Mouse control 代理-browser mouse move 100 200 # Move mouse 代理-browser mouse down left # Press button 代理-browser mouse up left # Release button 代理-browser mouse wheel 100 # Scroll wheel
Semantic locators (alternative to refs) 代理-browser find 角色 button 命令行工具ck --name "Submit" 代理-browser find text "签名 In" 命令行工具ck 代理-browser find text "签名 In" 命令行工具ck --exact # Exact match only 代理-browser find label "EmAIl" fill "user@test.com" 代理-browser fi