For AI agents: a documentation index is available at /llms.txt
Skip to main content

ClickOptions

Properties​

PropertyTypeDescription
scroll?booleanWhether or not to scroll to the element prior to clicking, defaults to true Default true
selector?stringA 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?numberHow 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?booleanWhether or not to click the element only if it's visible Default false
wait?booleanWhether or not to wait for the element to present in the DOM Default true
x?numberVision 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?numberSee x. The vertical screenshot-pixel coordinate to click.
Was this page helpful?