focus
Scroll to, move keyboard input to, or temporarily highlight a target element using a CSS or SeleniumBase selector, without clicking or typing.
Instructions
Scroll to, focus, or highlight an element.
This tool does not click, type, select, hover, or otherwise activate the
element. Use click, type_text, or hover_action for those operations.
Args: selector: CSS selector or SeleniumBase selector identifying the target.
action:
- "scroll_to_element": Scroll the element into the viewport.
- "focus": Move keyboard focus to the element.
- "highlight": Temporarily highlight the element for debugging or
demonstration by changing the border color. May affect timing
and/or reduce stealth.
timeout: Maximum seconds to wait for the target element. Default: 5.If there's no matching element found within the timeout, then @handle_sb_errors will return details from the exception raised.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | scroll_to_element | |
| timeout | No | ||
| selector | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |