Learn how to block cookie banners with taking screenshots
How it works
The easiest way to hide cookie banners in your screenshots is by using the block_consent_banners parameter.
When set to true, the API will automatically detect and block common cookie consent banners and popups on websites. This is the recommended approach for most use cases.
Automatic Cookie Banner Blocking
Simply add block_consent_banners: true to your API request:
This automatically handles the most common cookie consent frameworks including:
OneTrust
Cookiebot
Quantcast Choice
TrustArc
Osano
And many others
Recommended Method
Using block_consent_banners is the easiest and most reliable way to hide cookie popups. It’s maintained and updated regularly to handle new consent frameworks.
Manual CSS Injection (Advanced)
For custom cookie banners not covered by the automatic blocking, you can still use CSS injection.
Any CSS passed via the css param when generating a URL image will get injected into the page.
The hard part can be figuring out what CSS to use to block the cookie banner. To do this, we recommend visiting the site in Chrome. Use the developer tools inspector to find the ID or CSS class of the cookie banner (the css selector).
Then use this information to override the visibility of the cookie banner.
Here is an example that hides some common cookie banner.s