ScreenshotNeo

BlogHow-to

How to Fix ScreenshotOne Screenshots That Show a Cookie Consent Popup

Add ScreenshotOne’s cookie banner blocker, then use its documented fallback or a targeted CSS selector if the popup remains.

By the ScreenshotNeo team4 October 20265 min read

To remove a cookie consent popup from a ScreenshotOne screenshot, add block_cookie_banners=true to the ScreenshotOne /take request. The option defaults to off for URL captures, so make it explicit. ScreenshotOne documents it as blocking cookie banners, GDPR overlay windows, and related privacy notices. ScreenshotOne API options.

https://api.screenshotone.com/take?url=https%3A%2F%2Fexample.com&block_cookie_banners=true&access_key=YOUR_ACCESS_KEY

Keep your access key private. ScreenshotOne also accepts POST requests with JSON options; set the same option in the JSON body when using POST or an SDK.

1. Make the standard blocker explicit

For a GET request, include the option as a query parameter. URL-encode the target URL when constructing the request programmatically.

curl -G 'https://api.screenshotone.com/take' \
  --data-urlencode 'url=https://example.com' \
  --data 'block_cookie_banners=true' \
  --data 'access_key=YOUR_ACCESS_KEY' \
  -o screenshot.png

For a POST request, send the equivalent options in JSON. Check the API documentation for the exact endpoint and authentication arrangement used by your integration.

{
  "url": "https://example.com",
  "block_cookie_banners": true
}

After changing an SDK configuration, inspect the final request URL or serialized JSON. A setting in local code cannot help if the request builder omits it.

2. Use the heuristic fallback if the banner remains

If the regular blocker misses a page’s consent UI, try block_banners_by_heuristics=true. ScreenshotOne describes this as a different set of techniques for banners the regular option misses. It may affect screenshot precision, so inspect the resulting image for missing page content.

curl -G 'https://api.screenshotone.com/take' \
  --data-urlencode 'url=https://example.com' \
  --data 'block_cookie_banners=true' \
  --data 'block_banners_by_heuristics=true' \
  --data 'access_key=YOUR_ACCESS_KEY' \
  -o screenshot.png

3. Hide a known site-specific element

If the popup has a stable CSS selector, use hide_selectors to target it. ScreenshotOne applies display:none!important to matching elements before capture. This gives site-specific control, but it only changes what is rendered in the screenshot.

curl -G 'https://api.screenshotone.com/take' \
  --data-urlencode 'url=https://example.com' \
  --data 'hide_selectors=.cookie-consent-dialog' \
  --data 'access_key=YOUR_ACCESS_KEY' \
  -o screenshot.png

Replace .cookie-consent-dialog with the actual selector used on the target page. Inspect the site’s DOM and choose the narrowest selector that matches the consent overlay; a broad selector can hide unrelated content. The exact selector and page timing vary by site.

4. Use injected JavaScript only when necessary

ScreenshotOne supports custom scripts for changing page behavior. Consider this only when the documented blocker and a stable selector do not solve the issue and you understand the page’s DOM and loading behavior. Avoid generic scripts that remove broad classes or elements: they can silently remove page content. Consult the options documentation for the script parameter’s request format.

5. Check what the capture actually did

  1. Confirm the target URL is the page that displays the banner.
  2. Confirm block_cookie_banners=true is present in the final GET query or POST JSON.
  3. Inspect the returned HTTP status and response. ScreenshotOne documents human-readable error messages and error codes for API errors.
  4. If the request succeeds but the popup remains, try the heuristic fallback, then a verified site-specific selector.
  5. Compare the resulting screenshot with the page to ensure that the workaround did not remove wanted content.

Hiding a consent dialog in an image is a rendering change. It does not show that a visitor accepted or rejected cookies, that a consent cookie was written, or that the site’s consent requirements were fulfilled.

Common errors and fixes

Symptom Likely cause What to do
Popup is still visible The blocker was omitted, did not reach the request, or the page’s banner was not handled by the regular option. Inspect the final request, set block_cookie_banners=true, then try block_banners_by_heuristics=true.
More page content disappeared than expected A heuristic changed screenshot precision, or the selector matched too broadly. Remove the heuristic or narrow the selector; compare captures after each change.
Selector has no effect The selector does not match the page’s actual element, or the element differs across routes or variants. Inspect the rendered DOM for the target page and verify the selector against the element that contains the overlay.
API returns an error The request may be malformed, authentication may be missing, or an option may not have been serialized as expected. Check the HTTP status and ScreenshotOne’s error message and code. Verify the final query or JSON and keep the access key out of logs shared publicly.
Popup disappears, but the page behaves as if consent was not recorded Visual hiding did not register a consent decision. Do not treat a clean screenshot as proof of consent. Use the site’s actual consent flow when a recorded choice is required.

Reliability, performance, and cost considerations

The documented options provide three levels of control: the regular banner blocker for broad automatic handling, the heuristic fallback for cases it misses, and a selector for a known site-specific element. ScreenshotOne warns that the heuristic option may reduce screenshot precision. The research available for this article does not establish a success rate or performance benchmark, so validate the image for the specific pages in your workflow.

For repeat captures, keep a small set of representative URLs and review screenshots when a site changes its consent widget. If a workaround stops working, record the target URL, redacted request options, SDK or language, HTTP status, and returned error details before adjusting selectors or scripts.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server from ScreenshotNeo. It accepts one GET request for a URL and returns an image or PDF. Its clean-shot flow accepts cookie or consent banners like a visitor, then removes 60+ known consent platforms, newsletter popups, and chat widgets before capture. Each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers report the page verdict and billing status.

See the ScreenshotNeo API documentation for the request options. This example saves the returned image bytes as shot.webp:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed; an MCP server lets AI agents take screenshots; and 1,000 screenshots a month are free with no card. Paid plans start at $5 for 3,000 screenshots. Sign up for 1,000 free screenshots a month, with no card required.

FAQ

Does hiding the popup mean the visitor accepted cookies?

No. The capture changes the rendered image; it does not establish that the site recorded a consent choice.

Should I use the heuristic option on every page?

Use it when the regular blocker misses a banner, then inspect the image for unwanted changes to page content.

What information helps diagnose a popup that still appears?

Share the page URL if possible, a request with secrets redacted, the SDK or language, and the HTTP status and error details.