find_elements
Locate web page elements by text, role, CSS, XPath, or natural language, with filters for role and location, covering shadow DOM and same-origin iframes to get actionable refs.
Instructions
Find elements by text, role plus accessible name, natural-language
description, CSS, or XPath, and get back refs you can act on plus a note
on what was not searched. role='button' narrows any query to one
element role (field finding: 'Comment' alone matched 12; with the role
filter it matches the one button). This is the cheap targeted follow-up
that pairs with get_page_view: the page view tells you what string to
look for, and this retrieves it for a fraction of a full read.
Ambiguous results are listed rather than resolved, and zero results
come back with the nearest misses so a miss is a one-turn recovery.
The search covers the main document and every open shadow root in it,
and the matches it returns from a shadow root are actable like any
Same-origin iframes are searched too and the result says which ones
it entered. Two things stay out and the result counts both:
cross-origin iframes, which no tool here opens, and closed shadow
roots, which no tool can reach. XPath is the one kind that does not
enter a shadow root. location={'region': 'r7'} (or a ref, form, or table
from a read) narrows the search to that subtree, components inside it
included, and the first result line names the scope that was searched.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | auto | |
| page | Yes | ||
| role | No | ||
| limit | No | ||
| query | Yes | ||
| location | No |