browser-automation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhat I do
核心功能
- Provide a safe, composable workflow for browsing tasks
- Use list and index selection to click reliably
browser_query - Confirm state changes after each action
- 为浏览任务提供安全、可组合的工作流
- 使用的列表与索引选择实现可靠点击
browser_query - 在每个操作后确认状态变更
Best-practice workflow
最佳实践工作流
- Inspect tabs with
browser_get_tabs - Open new tabs with when needed
browser_open_tab - Navigate with if needed
browser_navigate - Wait for UI using with
browser_querytimeoutMs - Discover candidates using with
browser_querymode=list - Click, type, or select using
index - Confirm using or
browser_querybrowser_snapshot
- 使用检查标签页
browser_get_tabs - 必要时使用打开新标签页
browser_open_tab - 必要时使用进行导航
browser_navigate - 结合参数使用
timeoutMs等待UI加载browser_query - 使用的
mode=list发现候选元素browser_query - 通过参数执行点击、输入或选择操作
index - 使用或
browser_query确认操作结果browser_snapshot
Selecting options
选项选择操作
- Use for native
browser_selectelements<select> - Prefer or
value; uselabelwhen neededoptionIndex - Example:
browser_select({ selector: "select", value: "plugin" })
- 针对原生元素使用
<select>browser_select - 优先使用或
value参数;必要时使用labeloptionIndex - 示例:
browser_select({ selector: "select", value: "plugin" })
Query modes
查询模式
- : read visible text from a matched element
text - : read input values
value - : list many matches with text/metadata
list - : check presence and count
exists - : extract visible page text
page_text
- :从匹配元素中读取可见文本
text - :读取输入框的值
value - :列出所有匹配元素及其文本/元数据
list - :检查元素是否存在及数量
exists - :提取页面可见文本
page_text
Opening tabs
标签页打开操作
- Use to create a new tab, optionally with
browser_open_tabandurlactive - Example:
browser_open_tab({ url: "https://example.com", active: false })
- 使用创建新标签页,可选择性传入
browser_open_tab和url参数active - 示例:
browser_open_tab({ url: "https://example.com", active: false })
Troubleshooting
故障排查
- If a selector fails, run with
browser_queryto confirm the content existsmode=page_text - Use on broad selectors (
mode=list,button,a) and choose by index*[role="button"] - Confirm results after each action
- 如果选择器失效,使用的
mode=page_text确认内容是否存在browser_query - 对宽泛选择器(如、
button、a)使用*[role="button"],并通过索引选择元素mode=list - 在每个操作后确认结果