Skip to main content
The agentic_selector method attempts to perform actions on web elements using traditional CSS selectors first. If the selectors don’t produce a unique element, it falls back to using the Operator agent to perform the action intelligently.
This method combines the speed of traditional selectors with the reliability of AI agents. Use it when you want fast, precise element targeting with intelligent fallback for dynamic pages.

Method Signature

Parameters

action
AgenticSelectorAction
required
The action to perform on the element. Supported actions:
selectors
AgenticSelectors
required
CSS selectors to identify the target element. Available selector types:
fallback_operator_query
str
required
Natural language instruction for the Operator agent to use if selectors fail to find a unique element.
timeout
int | None
default:"300"
Maximum time in seconds to wait for the operation to complete. Default is 300 seconds since the Operator agent may need extra time when falling back.

Return Value

Returns an AgenticSelectorResponse object:
  • For get_text and get_property actions: response.value contains the extracted string.
  • For all other actions (click, fill, hover, etc.): response.value is None. The method completes when the action has been performed successfully.

Example