get_interactive_elements
Discover visible interactive elements on a web page, returning them with an assigned index for use with click or input tools.
Instructions
Retrieve visible interactive elements from the current web page.
Purpose
This tool scans the page for interactive elements using a performance-optimized selector that works across modern web applications (React, Angular, dynamic UIs).
It identifies elements based on interaction signals such as: - semantic HTML tags (button, input, link) - ARIA roles (button, link, tab, option) - click handlers (onclick) - focusable elements (tabindex)
The discovered elements are returned with an assigned index. This index
must be used when interacting with elements using tools such as:
- click_element
- type_into_element
The function also stores the discovered Selenium elements in an internal session cache so that subsequent tools can safely interact with the exact same elements without re-querying the DOM.
Recommended Agent Workflow
Navigate to a webpage using
open_url.Wait for the page to fully load using
wait_for_page.Call
get_interactive_elementsto discover UI elements.Review the returned list of elements and identify the correct element.
Use the provided
indexwith tools like:click_element(index)type_into_element(index, text)
Parameters
session_id : str Active browser session identifier.
Returns
dict { "session_id": str, "count": int, "elements": [ { "index": int, "role": str, "label": str } ], "status": str, "message": str }
Notes
The returned
indexis required for all interaction tools.Only visible and meaningful elements are returned to reduce noise.
This tool is optimized for speed and avoids scanning the entire DOM.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes |