find_element
Identify elements using visible text, tag, ARIA role, or nearby element, and retrieve the best CSS selector for reliable automation.
Instructions
Find elements by text content, tag, ARIA role, and/or proximity to another element, ranked by match quality. Returns {found, elements} with the best CSS selector for each. Use it to get a reliable selector from what you can see (e.g. a button's text) instead of guessing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | HTML tag filter (e.g. 'button', 'a', 'input') | |
| near | No | CSS selector of a nearby element (find elements near this one) | |
| role | No | ARIA role filter (e.g. 'button', 'link', 'textbox') | |
| text | No | Text content to search for (partial match) | |
| session_id | Yes | Session ID | |
| max_results | No | Max results (default: 5) |