browser_dom
Query an element's complete DOM state by CSS selector: visibility, text, attributes, computed style, and position. Use to confirm element existence and visibility before interactions.
Instructions
Query detailed DOM state of a single element matched by CSS selector: visibility, text, attributes, computed style, and bounding box position.
中文详情:
用途:查询指定 CSS 选择器元素的完整 DOM 状态,包括可见性、文本、属性、计算样式和位置坐标
何时使用:点击/输入前确认元素存在且可见时;调试元素被遮挡问题时;验证元素属性(disabled/readonly/checked)时;获取元素位置坐标用于截图时
输出:{ ok: boolean, selector: string, exists: boolean, visible: boolean, text: string, attributes: object, computedStyle: object, boundingBox: { x, y, width, height } }
参数:
selector (string, 必填):要查询的 CSS 选择器
错误:选择器无匹配返回 exists=false 但不抛出;选择器语法错误抛出 'Invalid selector'
示例:{"selector":"#submit-btn"}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS 选择器 |