browser_query_selector
Query the DOM using CSS selectors or XPath to locate elements across all frames, returning their IDs, text, and bounding boxes for direct interaction.
Instructions
Query the DOM using a CSS selector or XPath and return matching elements with their backendNodeIds, text, and bounding boxes. Automatically searches across all frames (pierces iframes).
PREFER get_semantic_surface for page understanding. Use this tool only when you need to find elements by a specific CSS selector that the AX tree doesn't surface (e.g., elements with specific data-* attributes).
Returns backendNodeIds that can be used directly with atomic_interact.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector or XPath (prefix with "xpath/") to query | |
| timeoutMs | No | Wait this many ms for the element to appear (default: 0 = instant check) | |
| visibleOnly | No | Only return visible elements (default: false) |