click
Activate the first element matching a CSS or Playwright text selector; declare form submits or downloads to request permission and avoid blocked actions.
Instructions
Click the first element matching selector (CSS or Playwright text=).
Set submits=true when the control sends a form or completes a
purchase — that asks for the permission it needs. If the page submits
anyway without you declaring it, the request is stopped, so declare it
when you mean it. reason is shown to the user when they are asked.
Fails fast instead of hanging. A selector that matches nothing answers
not_found, and a match that cannot be used hidden or disabled
— each after at most a few seconds' wait for a page that is still
building or enabling its controls, and before anyone is asked. Once
clicking, timeout_ms (default 10000, max 30000) bounds the wait, and
a failure answers timeout (the click may have landed — look at the
page before clicking again), element_not_actionable (covered,
detached) or page_closed.
The reply says how many elements matched (matches; the first is
clicked) and what was hit (clicked: tag, role, name), so a wrong
pick is visible.
If the click makes the page navigate and the browser refuses it — no
approval covers the destination, or a form was sent without
submits=true — the reply is blocked_by_policy (with url, where
the tab still stands, and redirected_to when the site redirected the
browser elsewhere) and the tab has not moved: navigate to the
destination to be asked for it. A click that opens a tab answers
new_tab: true and tab_count; the new tab is the one every later
call reads and acts on (tabs goes back).
Set download=true when the click is meant to save a file: that asks for
permission to write one, and the reply carries download (filename,
path, bytes, url_origin) once it is saved. A click that starts a
download without it is cancelled and answered download_blocked — nothing
is saved, so repeat the click with download=true. The permission pays for
one file and ends with the call.
A native dialog the page raised is answered at once and listed under
dialogs in the reply; handle_dialog chooses the answer beforehand.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | No | ||
| confirm | No | ||
| submits | No | ||
| download | No | ||
| selector | Yes | ||
| timeout_ms | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||