Query CSS selector
query_selectorFind elements by CSS selector and return tag, text, href, id, and class. Pull repeated structures such as search results or table rows without a full snapshot.
Instructions
Find elements by CSS selector; list their tag, text, href, id and class.
The efficient way to pull a repeated structure off a page — search results, product tiles, table rows — without paying for a full snapshot.
Returns a compact listing only. It yields no uids, so it cannot drive clicks: take a snapshot when you need to interact, or operate on the elements directly via evaluate_script.
Element text is truncated to 200 characters.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frame | No | Read inside one of the page's frames instead of the main document: an index or frame id from list_frames. Chrome's DOM queries never cross a frame boundary, so anything inside an iframe is unreachable without this. The frame is read through an isolated world, which shares the DOM but not the page's own JavaScript variables. Empty string reads the main document. | |
| limit | No | Maximum number of matching elements to return. | |
| browser | No | Which browser to act on. Each name is an independent Chrome, created on first use. Omit for the shared default; parallel agents each need their own name. | default |
| selector | Yes | A CSS selector, e.g. "a.result", "#nav li", "input[type=file]". Standard querySelectorAll syntax — no jQuery extensions such as :contains(). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |