查找元素
find_elementLocate an element in a specified tab using a locator (CSS, XPath, text, etc.) and optional frame, index, and timeout, returning an element ID for further interaction.
Instructions
在标签页中定位一个元素,返回摘要与 element_id(供交互工具使用)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frame | No | 搜索范围:省略=主文档+自动穿透 iframe;'main'=仅主文档; 'active'=激活态 iframe;也可用序号或 iframe 的 id/name(见 frame_list) | |
| index | No | 第几个匹配元素(从 1 开始,负数表示从末尾倒数) | |
| tab_id | No | 标签页 id,省略时用最新标签页 | |
| locator | Yes | 定位符,如 '#kw'、'.btn'、'tag:input'、'@name=q'、'text:搜索'、 'css:.list>li'、'xpath://a[@href]'、'ax:@role=button';不带前缀时自动匹配 | |
| timeout | No | 未找到时的最长等待秒数 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | ||
| text | No | ||
| xpath | No | ||
| element_id | Yes | ||
| css_selector | No |