Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →To remove a cookie banner from a screenshot without accepting tracking, hide the specific banner with CSS at screenshot time. Do not click “Accept” or preload a consent cookie. This changes the image, not the site’s consent state: the page may still send tracking requests, and the screenshot cannot prove otherwise.
Hide the banner only for the screenshot
With Playwright, inspect the target page to identify its actual banner container, then pass a narrowly scoped CSS rule through the screenshot API’s style option. Replace the example selector below with one verified on the page you are capturing:
await page.screenshot({
path: 'page.png',
style: '.REPLACE_WITH_VERIFIED_BANNER_SELECTOR { display: none !important; }'
});
The rule is applied for the screenshot; it does not click a consent control or record a consent decision. Check the rendered result to ensure the selector hides only the banner and leaves the rest of the page intact. Site markup varies, so there is no universal selector.
Use a clean browser context and avoid consent actions
- Create an isolated, non-persistent Playwright browser context. This prevents the capture from inheriting cookies and other stored state from an earlier browser session. Playwright documents isolated contexts and methods for inspecting or clearing cookies in its BrowserContext documentation.
- Load the page without accepting or preloading consent. Do not click an accept button or insert a saved consent cookie just to clear the image. The page’s own scripts may still make network requests.
- Inspect the page and verify the banner selector. Choose the narrowest selector that identifies the banner on the target site, then apply it using the screenshot code above.
- Review the screenshot. Confirm the intended content remains visible and only the banner was hidden.
Playwright’s Page screenshot documentation describes the screenshot style option. Its addInitScript mechanism is separate: the documentation says that script is evaluated after the document is created but before its scripts run. That wording is not a claim that screenshot CSS blocks scripts or prevents tracking.
Know what each approach changes
| Approach | What it changes | When it fits | Important limitation |
|---|---|---|---|
| Capture-time CSS | Screenshot presentation | You need a clean visual image without making a consent choice | Does not make or verify a consent decision; the selector is site-specific. |
| Use the site’s reject or preferences control | The site’s consent interaction or state | You need to test or exercise the consent controls | This is a consent interaction, not screenshot-only cleanup. |
| Use the site’s accept control | The site’s acceptance interaction or state | Testing acceptance behavior | It conflicts with the goal of not accepting tracking. |
For example, Browserless’s cookie-consent example clicks an accept-like selector before taking a screenshot. That is not the right workflow when you want to avoid accepting tracking.
As an Amazon Associate I earn from qualifying purchases.
A hidden banner does not establish privacy or consent
- CSS hiding only changes what appears in the captured image. It does not mean consent was rejected, stored, or respected.
- A clean screenshot does not show whether cookies, pixels, or other tracking requests ran. Inspect or control browser storage and network activity separately if you need to investigate them; the screenshot technique alone is not a tracking audit.
- Use this method only for pages you are authorized to view. Whether a particular site’s interface or capture workflow meets a legal obligation depends on the site and jurisdiction; this visual technique does not answer that question.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. Its clean-shot workflow accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. This is a different workflow from applying a CSS rule without making a consent choice, so use the DIY method above if you specifically require capture-only hiding without accepting or recording consent.
For a one-call capture, see the ScreenshotNeo API documentation:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo bills only clean shots: bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and each response identifies the page verdict and billing status in X-Page-Verdict and X-Billed headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
#1 Best Overall
The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for 1,000 free screenshots a month with no card.
Quick Recap
Best Value
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Rank #3
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.




