query_text
Find page elements by their visible text, even when CSS selectors are unreliable. Returns the actionable element for clicking.
Instructions
Find elements by visible text content. Returns the smallest/deepest element whose textContent matches the needle, with chrome (header/nav/footer/aside) skipped. Anchor-promotion: a span/strong/etc. inside an resolves to the anchor (so click() targets the actionable element). Right tool when CSS selectors are unstable (React-rendered pages with hashed class names) but the visible label is reliable — e.g. find a 'Sign in' button without knowing its class.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exact | No | If true, exact match instead of substring (default false) | |
| limit | No | Max matches to return (default 20) | |
| selector | No | Optional CSS selector to limit search scope (default: whole document body) | |
| text | Yes | Substring to match (or exact string if exact=true) |