browser_search
Find web page elements using text, regex, roles, or CSS selectors to target specific content for interaction.
Instructions
Grep-like element search across the current page. by: 'text' (literal substring), 'regex', 'role', 'ariaLabel', 'selector' (CSS). Returns results[] sorted by confidence descending — pass results[0].selector to browser_click_element. Pagination via offset/maxResults. Caveats: Use browser_get_interactive for broad discovery; use browser_search when you know specific text or role to target.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| by | Yes | Search axis: text/regex/role/ariaLabel/selector | |
| pattern | Yes | Pattern to match against the chosen axis. | |
| scope | No | CSS selector to limit the search scope. | |
| maxResults | No | Max results returned (default 50). | |
| offset | No | Offset into the result set (default 0). | |
| visibleOnly | No | Only visible elements (default true). Set false to include hidden ones with confidence penalty. | |
| inViewportOnly | No | Only currently-in-viewport elements (default false). | |
| caseSensitive | No | Case-sensitive matching for text/regex (default false). | |
| tabId | No | Tab ID from browser_connect. Omit to use the first page tab. | |
| port | No | Chrome/Edge CDP remote debugging port. |