To remove a cookie banner from a screenshot without accepting cookies, hide the known banner only at capture time with a narrow CSS rule or screenshot mask. That changes the image, not the site’s consent state. If you need a screenshot after a real visitor choice, click the intended consent control, verify the result, and then capture.
Choose between a clean screenshot and a real consent choice
These are different jobs, and the right method depends on what the screenshot must prove.
- Visual cleanup: Keep the page’s consent state untouched but omit the overlay from the image. Use a page-specific screenshot style or mask.
- Consent-flow capture: Record the result of a visitor action. Click the intended accept, reject, or preferences control, then confirm the page reflects that choice before taking the screenshot.
Hiding an overlay is not the same as accepting or rejecting cookies. A CSS rule or mask can make a banner invisible while the site still has not recorded any choice.
Hide a known banner in Playwright without changing consent
For a one-off capture, Playwright can apply CSS only while taking the screenshot. Identify the banner container on the target site first, then use a specific selector. The example below is runnable after installing Playwright and replacing the URL and selector with values from your page.
Free tools Windows power users keep installed
One-click scans. No signup required.
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1440, height: 1000 } });
try {
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
await page.screenshot({
path: 'page-without-banner.png',
fullPage: true,
style: '[data-testid="cookie-banner"] { display: none !important; }'
});
} finally {
await browser.close();
}
Replace [data-testid="cookie-banner"] with a selector that targets only the consent overlay on the page you are capturing. If the site has no stable test ID, inspect its markup and choose a site-specific class or other unique locator. Playwright documents screenshot-time style and mask options in its Page API; check the documentation for the version installed in your project.
Use a mask when you only need to cover the region
A locator mask can obscure a known element in the screenshot without dismissing it. For example, after identifying the element with a locator, pass it in mask:
const banner = page.locator('[data-testid="cookie-banner"]');
await page.screenshot({ path: 'page-masked.png', mask: [banner] });
Masking covers the target area; it does not remove the banner from the page or establish consent. Inspect the resulting image to make sure the mask has not covered important content.
Keep the change temporary and narrow
Screenshot-time CSS is useful for one-off images because it does not require changing the website’s source stylesheet or storing a consent choice. Avoid broad rules such as selectors matching every element containing “cookie,” “popup,” or “overlay.” Those terms can appear in unrelated controls and page content. A broad match may remove more than the banner and produce a misleading image.
Capture the page after a real consent choice
If you are testing the consent experience, interact with the actual control that the test is meant to exercise. Use an accessible role and name where possible, or a page-specific selector when the site’s markup requires it. Then wait for an observable post-choice condition before capturing.
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage();
try {
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
// Change the role and accessible name to the intended control on this site.
await page.getByRole('button', { name: 'Reject optional cookies' }).click();
// Wait for a visible outcome that indicates the choice took effect.
await page.locator('[data-testid="cookie-banner"]').waitFor({ state: 'hidden' });
await page.screenshot({ path: 'after-rejecting-cookies.png', fullPage: true });
} finally {
await browser.close();
}
The button label and confirmation condition are site-specific. A banner disappearing is useful evidence that the interface changed, but for a consent test, verify the expected preference or persisted state when the site exposes one. Browserless shows one browser-automation approach to dismissing consent controls, but its example does not establish a universal selector or guarantee coverage across sites: Browserless cookie-consent example.
Why selectors and verification matter
Consent banners do not share one standard button attribute or wording. A 2024 study in Proceedings on Privacy Enhancing Technologies examined a study-specific dataset of 483 sites with consent banners and identified 97 distinct accept-all button labels. Those are findings from that paper’s dataset, not current totals for the web; they illustrate why an automation script may need site-specific controls. See the 2024 study PDF.
Before saving a screenshot, check that the main page content remains intact and that the intended result is visible. A hidden banner can expose content that would normally be covered, while a clicked control can trigger layout changes or a confirmation panel.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesCan a browser setting or extension block banners?
For repeated manual browsing, browser features or extensions may reduce consent notices, but coverage and behavior vary by site. Mozilla’s current support article says its Firefox cookie banner blocker “is not currently available anymore” and points readers to uBlock Origin’s cookie-notice filter lists. The same article describes the former Firefox feature as beginning in Firefox 120 and applying automatically to users in Germany in Private Browsing Mode for supported sites with a decline option; that description is historical, not current availability. Mozilla Support’s article, “Block cookie banners on Firefox,” was reported as last updated May 23, 2025: Mozilla Support.
Or skip the browser setup
For a hosted screenshot call, ScreenshotNeo accepts a URL and returns an image or PDF. This cURL example captures a page as WebP; see the ScreenshotNeo documentation for options and setup.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots.
Sign up for 1,000 free screenshots a month, with no card required.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Troubleshooting
The CSS rule does not hide the banner
Confirm that the selector matches the banner container after the page loads. The consent interface may be inserted dynamically, use a different element, or live inside an iframe. Inspect the page and adjust the selector; do not broaden it indiscriminately.
The banner disappears, but the screenshot still shows it
For a consent interaction, wait for the banner’s hidden state or another reliable post-choice condition before capture. For screenshot-time CSS, pass the style option to the screenshot call itself and confirm the installed Playwright version supports it.
The page looks incomplete after hiding the banner
Check whether the selector matches a wrapper containing both the banner and other page content. Target the smallest element that represents only the overlay, or use a locator mask if the task is simply to cover the banner area.
The button locator cannot find the reject control
Inspect the button’s accessible name and role, including whether the control is inside a frame. Update the locator for the target site and wait for the control to become available before clicking. There is no universal consent-button selector.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
FAQ
Does hiding a cookie banner count as rejecting cookies?
No. Hiding it changes what appears in the image; it does not itself submit a consent choice to the site.
Can I use this approach for repeated screenshots?
Yes. Put a page-specific style or interaction into your automation and verify the expected result for each target site. For different sites, expect selector and button-label differences.
Quick Recap
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
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.

