Free tools Windows power users keep installed
One-click scans. No signup required.
Use Playwright to create a new, non-persistent browser context, open the target page, accept its consent prompt, verify that the prompt is gone, and then save the screenshot. A fresh context isolates cookies and other browser state from other contexts and does not write browsing data to disk. The consent button and the right post-click wait depend on the site.
Capture the page after accepting cookies
The example below uses Playwright with JavaScript. Install Playwright and its Chromium browser in your project, then save this as an ES module, such as capture.mjs. Replace the URL and adapt the consent locator and wait condition to the target site; the button name shown is an example, not a selector verified for a particular site.
As an Amazon Associate I earn from qualifying purchases.
import { chromium } from 'playwright';
const targetUrl = 'https://example.com';
const browser = await chromium.launch();
try {
const context = await browser.newContext();
try {
const page = await context.newPage();
await page.goto(targetUrl, { waitUntil: 'domcontentloaded' });
const acceptButton = page.getByRole('button', {
name: /accept all cookies/i,
});
await acceptButton.click();
// Verify a meaningful post-consent condition before capturing.
await acceptButton.waitFor({ state: 'hidden' });
await page.screenshot({ path: 'after-consent.png', fullPage: true });
} finally {
await context.close();
}
} finally {
await browser.close();
}
The script creates a new context for this run, navigates, interacts with a button identified by accessible role and name, waits for that button to disappear, and captures the whole page. Use a condition that reflects the site’s actual behavior: some consent interfaces hide the banner, replace it, or update another visible element after a choice.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteChoose the right consent interaction
Match the target site’s control
Consent UI varies by site, language, region, and consent manager. Inspect the page and use a locator that identifies the intended action, such as a button with its accessible name. Do not assume “Accept all cookies” is the label or that a button is directly available in the main page: a site may use a different control, iframe, or UI structure.
If the control is inside an iframe, locate the relevant frame and interact with its consent button there. If the UI is rendered in a shadow root, use a locator that can reach the actual control. The exact frame or selector cannot be determined without the target URL.
#1 Best Overall
Wait for the result, not just the click
A successful click is not by itself proof that the desired state was applied. Wait for the banner to become hidden or for a site-specific signal that indicates consent was recorded. If the site updates asynchronously, use an explicit locator wait rather than relying on a short fixed delay. The appropriate condition is site-specific.
Decide whether to start fresh or reuse consent
Use a fresh context to test the consent flow
A non-persistent Playwright context is isolated from other contexts, including their cookies and local and session storage, and does not persist its browsing data to disk. This makes it suitable when the goal is to encounter the consent prompt in a clean session and accept it during the run. See Playwright’s browser-context isolation guide.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Save and restore state for repeat captures
If you want to accept consent once and use that state in a later newly created context, save the current context’s storage state and provide it when creating the next context:
Rank #2
// After accepting consent in the first context:
await context.storageState({ path: 'state.json' });
// In a later run:
const context = await browser.newContext({ storageState: 'state.json' });
Playwright documents storage-state reuse, including cookies and a local-storage snapshot; its API also documents an option for IndexedDB snapshots. Whether that is enough depends on where the particular site stores its consent choice. A saved state should not be treated as universal proof that consent will carry over: confirm the site’s behavior and protect the state file as browser data. See Playwright’s authentication and storage-state guide and the BrowserContext storageState API.
Choose the screenshot scope and repeatability settings
Viewport or full page
By default, a screenshot captures the visible viewport. Set fullPage: true to capture page content beyond the current viewport. Use the viewport version for what a user sees at a particular scroll position; use full-page capture when the deliverable should include the page from top to bottom. Playwright also supports screenshot style overrides. See the Playwright screenshot guide and Page screenshot API.
Rank #3
Keep visual comparisons consistent
For repeatable comparisons, keep the browser engine, viewport dimensions, device scale, locale, and timing conditions consistent across runs. Decide these conditions based on the comparison you are making; the correct viewport and timing are not defined for an unspecified target page.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteTroubleshoot common failures
- The locator times out: the button text may differ, the control may be in an iframe, or the banner may not have appeared. Inspect the rendered page and adjust the locator to the target’s actual UI.
- The click succeeds but the banner remains: the clicked control may not be the intended accept action, or the interface may update asynchronously. Verify the post-click UI and wait for the expected state.
- The prompt returns in a later run: a fresh context starts without the prior run’s browser state. If you intentionally want to reuse consent, save and restore storage state, then confirm the site stores the choice in mechanisms covered by that state.
- The screenshot is taken too early: navigation completion does not guarantee that consent UI or post-consent content has settled. Wait for the relevant locator or another site-specific condition before capturing.
- The screenshot omits page content: enable
fullPage: truewhen you need the full document rather than the visible viewport.
Or skip the browser setup
ScreenshotNeo offers a one-request screenshot API, with options for formats including PNG, JPEG, WebP, or PDF. Its consent handling accepts cookie or 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 or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses indicate the page verdict and billing status in headers. It also provides an MCP server with screenshot, page-info, and PDF tools for AI agents. See ScreenshotNeo and the API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
The call saves the response as shot.webp; provide your API key and the target URL. The free plan includes 1,000 screenshots per month without a card, and paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month, with no card required.
Frequently Asked Questions
Does a fresh Playwright context delete cookies from my regular browser?
No. A Playwright non-persistent context is separate from your regular browser profile; it does not clear that profile’s cookies.
Can I use this method with a website that has no cookie banner?
Yes. The capture can proceed without a consent click, but make the interaction conditional on the site’s UI so the script does not wait indefinitely for a button that is absent.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Quick Recap
Best Value
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.




