scroll? | boolean | Whether or not to scroll to the element prior to clicking, defaults to true Default true |
selector? | string | A query-selector compatible string, JavaScript that returns an HTML Node, OR a Browserless-deep query. Examples include: - A simple <button /> Element: selector: "button" - A JavaScript snippet that returns a button element selector: "document.querySelector('button')" - A Browserless Deep query. These queries must start with a "<" character. Deep queries will traverse all iframes, shadow-doms (open or closed), and more. Basic deep query: selector: "< button" Advanced deep query features: - URL Pattern Matching: Target elements within specific iframes using glob patterns selector: "< https://example.com/* button.active" selector: "< *google.com/recaptcha* #recaptcha-anchor" - Complex Selectors: Combine multiple attributes, classes, and IDs selector: "< input#username.login-form[type='text'][data-test-id*='user']" - Attribute Matching: Use various attribute matching operators - Contains (*): [data-test*="partial"] - Starts with (^): [class^="prefix-"] - Ends with ($): [id$="-suffix"] - Exact match: [type="submit"] - Presence only: [required] - Class and ID Combinations: selector: "< button#submit.primary.large[data-action='save']" For reCAPTCHA interactions, you can use deep selectors to target elements within the reCAPTCHA iframe: selector: "< *google.com/recaptcha* #recaptcha-anchor" Note: Deep selectors support standard CSS selector syntax while maintaining security by disallowing potentially dangerous characters and patterns. Omit selector to click by coordinate instead — pass x and y (see below). |
timeout? | number | How long to wait for the element to appear before timing out on the click handler, overriding any defaults. Default timeout is 30 seconds, or 30000. |
visible? | boolean | Whether or not to click the element only if it's visible Default false |
wait? | boolean | Whether or not to wait for the element to present in the DOM Default true |
x? | number | Vision fallback: click at a raw screenshot-pixel coordinate instead of a selector. Read the target's pixel off a viewport screenshot and pass it here; the server maps screenshot pixels to the page (dividing by the device pixel ratio). Provide both x and y, or use selector instead — not both. Coordinates are viewport-relative, so take a non-fullPage screenshot. |
y? | number | See x. The vertical screenshot-pixel coordinate to click. |