Discover how to interact with buttons, links, or other webpage elements before capturing a screenshot. This powerful feature allows you to automatically click elements, dismiss popups, and handle dynamic content that would otherwise interfere with your screenshot capture.
This functionality is particularly useful for handling pop-up messages, cookie consent banners, notifications, and other dynamic elements that appear on modern websites.
You need to specify the element you want to interact with using the click
parameter. The interaction can be specified by various element selectors:
&click=OK
- clicks element with text "OK"&click=mybutton
- clicks element with name "mybutton"&click=#mybutton
- clicks element with ID "mybutton"&click=.gdpr-button
- clicks element with class "gdpr-button"Check out our element selection guide for more detailed examples and advanced techniques.
To interact with multiple elements in sequence, repeat the click parameter:
&click=.button1&click=.button2&click=#close-modal
Element interaction is particularly valuable for these scenarios:
The screenshot below displays a website with a "This site uses cookies..." header and an OK button that needs to be dismissed.
Locate the button labeled "OK" and click on it to dismiss the notice:
// Line breaks added for readability https://api.addscreenshots.com/screenshots
?apikey=YOUR_API_KEY
&click=OK
&url=wherescape.com
Your API key can be found on the API Keys page. Need an API Key? Sign up to get started.
For internal applications, replace YOUR_API_KEY with your own unique API Key.
For public facing websites or hotlinks, generate a signed URL.
Locate the button by the class name ".gdpr-viewed-action" and click on it to dismiss the notice:
// Line breaks added for readability https://api.addscreenshots.com/screenshots
?apikey=YOUR_API_KEY
&click=.gdpr-viewed-action
&url=wherescape.com
After clicking the element, the screenshot is captured without the intrusive banner:
Combine element clicking with other powerful features for complex scenarios:
Use browser developer tools to inspect elements. Right-click on the element and select "Inspect" to see its HTML structure, then identify the text, ID, class, or name attribute to use in your click parameter.
Yes! Use multiple click parameters in your API request: &click=button1&click=button2&click=#close
. Elements will be clicked in the order specified.
If the specified element isn't found on the page, the screenshot will be captured without any interaction. No error will occur, ensuring your screenshot process continues.
Absolutely! Element interaction works perfectly with full-page screenshots. The element will be clicked before the full page capture begins.
Combine element clicking with wait delays to ensure dynamic elements are fully loaded before attempting to click them.
Yes! Element interaction works with all viewport sizes, including mobile and tablet dimensions.
You can click any clickable element including buttons, links, checkboxes, radio buttons, and custom interactive elements. The element must be visible and accessible on the page.
Start automating your screenshot captures with element interaction using our free plan - 100 screenshots monthly at no cost.