click
Trigger actions on web elements using CSS or text selectors, with control for specific matches, visibility, scrolling, and timeouts.
Instructions
Click one or more elements matching a selector.
This is the primary element-clicking tool. The selector may be a CSS selector or SeleniumBase text-matching selector such as 'a:contains("Sign in")'.
Args: selector: Target CSS selector or text-matching selector. nth: Click only the Nth matching element, using 1-based indexing. Takes priority over all_matches. all_matches: Click every currently visible matching element, in order. Ignored when nth is provided. only_if_visible: Attempt the click only when the target is already visible. Does not wait for the element to become visible. parent_selector: Restrict the nested lookup to a parent element. Useful for elements inside iframes or nested containers when supported by SeleniumBase. timeout: Seconds to wait for a basic click when no specialized mode is selected. Defaults to 7 seconds. scroll: Scroll the target into view before clicking.
Tool selection: - Click one matching element -> basic click. - Click a specific matching occurrence -> set nth. - Click every visible match -> set all_matches=True. - Click only when already visible -> set only_if_visible=True. - Click an element nested inside another element -> set parent_selector.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nth | No | ||
| scroll | No | ||
| timeout | No | ||
| selector | Yes | ||
| all_matches | No | ||
| only_if_visible | No | ||
| parent_selector | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |