Use Playwright to process a URL list in a browser context: open each page, handle that site’s consent interface, verify it has closed, wait for the content you need, and save the screenshot under a predictable filename. There is no universal cookie-banner selector, so consent handling must be tailored to each site. For managed capture instead, ScreenshotNeo offers a one-request screenshot API and an MCP server for AI agents.
Build a repeatable Playwright batch
The basic loop is URL → navigation → consent handling → readiness check → screenshot → result logging. A shared browser context can reduce setup overhead, but do not assume unrelated sites use the same consent controls or share a consent choice. The example below is a runnable Node.js starting point. Replace the consent locator and readiness selector with values that match the target site.
Install Playwright
-
Create a project and install Playwright:
npm init -y, thennpm install playwright.As an Amazon Associate I earn from qualifying purchases.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Save the script below as
capture.mjsand run it withnode capture.mjs. It creates anoutputdirectory and processes the example URLs.
Node.js batch example
import { chromium } from 'playwright';
import fs from 'node:fs/promises';
const urls = [
'https://example.com',
'https://www.example.org',
];
const outputDir = 'output';
await fs.mkdir(outputDir, { recursive: true });
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({ viewport: { width: 1440, height: 900 } });
function fileName(url, index) {
const parsed = new URL(url);
const slug = `${parsed.hostname}${parsed.pathname}`
.replace(/[^a-z0-9]+/gi, '-')
.replace(/^-|-$/g, '')
.slice(0, 100);
return `${String(index + 1).padStart(3, '0')}-${slug || 'page'}.png`;
}
for (const [index, url] of urls.entries()) {
const page = await context.newPage();
let status = null;
let consent = 'not configured';
try {
const response = await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 45000 });
status = response?.status() ?? null;
// Replace this locator with the site's actual, appropriately scoped control.
const consentButton = page.getByRole('button', { name: 'Accept all cookies', exact: true });
if (await consentButton.isVisible().catch(() => false)) {
await consentButton.click();
consent = 'clicked';
// Replace with the site's banner/dialog locator to verify it is gone.
await page.getByRole('dialog').waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {});
} else {
consent = 'button not visible';
}
// Replace with an element that indicates the content you need is ready.
await page.locator('main').waitFor({ state: 'visible', timeout: 15000 }).catch(() => {});
await page.screenshot({ path: `${outputDir}/${fileName(url, index)}`, fullPage: true });
console.log(JSON.stringify({ url, status, consent, result: 'saved' }));
} catch (error) {
console.error(JSON.stringify({ url, status, consent, result: 'failed', error: String(error) }));
} finally {
await page.close();
}
}
await browser.close();
The example uses domcontentloaded to begin processing once the initial document has been parsed, then waits for a page-specific element. Its broad example locators are not universal: if the site has no main element or its button wording differs, replace them. The dialog wait is also an example; use the actual banner or dialog locator when possible and make a missing or still-visible banner explicit in your logs rather than treating a click as proof of success.
Use a careful consent action
Choose the control that matches the task and applicable instructions. A button that closes a banner may also record a consent preference; “accept all” is not interchangeable with dismissing a visual overlay. Prefer accessible roles and names, scoped to the consent interface where possible. Verify that the overlay is no longer visible before capturing.
Choose readiness and screenshot scope
Wait for the content, not network silence
Playwright supports navigation wait conditions such as load and domcontentloaded. Its Page API discourages networkidle as a generic readiness condition: modern pages may keep connections open, and a quiet network does not necessarily mean the content you need is ready. Wait for a page-specific visible element or another meaningful condition instead. See the Playwright Page API.
#1 Best Overall
- ULTRA HD 4K CLARITY: Stand out in every video call with breathtaking 4K video at 30fps or smooth 1080p at 60fps. Powered by a premium 1/2.5" CMOS sensor and a wide f/1.78 aperture, this webcam captures every detail with vibrant color and stunning low-light performance-so you always look your best
- FAST AUTOFOCUS & SMART LIGHT CORRECTION: No more blurry moments with this webcam for PC. Advanced Phase Detection Auto Focus (PDAF) locks onto your face instantly and keeps you sharp-even when you move. Built-in light correction adapts to your environment, balancing brightness and contrast for a flawless image in dim rooms or bright spaces
- DUAL NOISE-CANCELING MICS: Speak with confidence using this webcam with microphones. Dual microphones with intelligent noise-canceling tech isolate your voice and reduce background noise-suitable for webinars, live streams, team meetings, and virtual interviews
- WIDE-ANGLE LENS & FLEXIBLE MOUNTING OPTIONS: Capture more of your world with an 80 field of view and full 360 swivel rotation. Whether this streaming webcam is mounted on a laptop, monitor, or tripod, it allows you to find the right angle for any setup
- BUILT-IN PRIVACY COVER & PLUG-AND-PLAY SIMPLICITY: Protect your privacy with a secure sliding lens cover that blocks the camera when not in use. Setup is a breeze-just plug into any USB-A port and start streaming, chatting, or recording instantly. The USB webcam is compatible with Zoom, Microsoft Teams, Skype, OBS Studio, and all major platforms across Windows, macOS, and Linux
For pages that load content as you scroll, a full-page screenshot may not include assets that have not yet been loaded. If those assets matter, scroll or otherwise trigger the relevant lazy-loaded content and check the result before saving.
Pick the capture scope deliberately
| Capture | Use it for | Trade-off |
|---|---|---|
| Viewport | A consistent initial-screen comparison or a fixed visible region. | Content outside the viewport is omitted. |
| Full page | A record of the page’s full scrollable document. | Images can be very tall; lazy-loaded content may need additional handling. |
| Element | A chart, panel, or specific content block. | Requires a reliable locator for that element. |
Playwright documents screenshot paths and options, including full-page capture and device-scale output. CSS scale gives one output pixel per CSS pixel; device scale uses device-pixel density and can produce larger files. The Playwright screenshot guide also describes viewport, full-page, and element captures.
Organize output and handle batch failures
Use stable names derived from a sanitized hostname and path, or a stable index paired with the URL in a manifest. Add a run date or identifier if each run must be preserved rather than overwritten. For each URL, record the final URL if redirects matter, the navigation response status when available, whether the consent control was found and verified closed, and whether the screenshot was written.
A navigation response with an HTTP error status does not necessarily throw an exception. Inspect the returned response status and decide whether a 404 or 500 page should be captured or marked as a failed target. A timeout or navigation exception should be logged separately from a valid HTTP response.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #2
- 【Efficient Quad-Core Performance】 Powered by a 1.8GHz Quad-Core processor, this mini laptop ensures smooth multitasking. With 2GB RAM and 64GB ROM (expandable to 1TB), it handles daily work and online tasks with ease.
- 【10.1" HD IPS Display & GMS Support】 Featuring a 1280x800 HD IPS screen, this cheap laptop delivers vibrant visuals. Pre-installed with Android OS and GMS, you get direct access to the Google Play Store for apps.
- 【Ultra-Portable & Lightweight Design】 Weighing only 1.76 lbs, this Blue computer is designed for mobility. Its compact form makes it an ideal companion for students and professionals for home schooling or trips.
- 【Versatile Connectivity Options】 Stay productive with dual USB 2.0 ports, a headphone jack, and a TF card slot. This computer for kids and adults features built-in Wi-Fi and Bluetooth for stable connections.
- 【Complete All-in-One Bundle】 This kid laptop kit includes the laptop, carrying bag, mouse, mouse pad, and power adapter. It is the perfect ready-to-use set for online classes, remote work, and entertainment.
Concurrency and reliability
Start with sequential captures, then introduce bounded concurrency only after checking failure rates and the target sites’ behavior. One Delft University of Technology thesis describes a collector with a default batch size of 15; that is one implementation setting, not evidence that 15 parallel pages is safe or optimal for other sites. Respect site terms and access controls, and reduce concurrency if requests are being throttled or pages become less reliable.
Reuse consent state only when it is appropriate
If a site stores a choice in cookies or local storage, a saved Playwright storage state may allow a later run to start with that state. That does not guarantee a particular consent manager uses those stores, or that a choice carries across domains. Confirm the behavior on each target rather than assuming dismissal persists.
Playwright’s authentication-state guidance explains reusable browser state, including cookies and local storage, and notes that session storage behaves differently and is not persisted across page loads. Treat saved state files as sensitive: they may contain cookies or headers usable to impersonate an account. Keep them out of version control and limit access.
Troubleshoot common problems
-
The banner remains visible. Inspect the page’s accessible structure, use its actual button name and role, and verify the banner itself is hidden. A click may have missed the control or opened settings instead.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
The banner returns on every page or run. Check whether the choice is domain-specific, whether the same browser context is reused, and where that site stores consent state. Do not assume storage state solves it without confirming on the target.
-
The screenshot is blank or incomplete. Check navigation errors and response status, then wait for a meaningful page-specific element. If the missing material is below the fold, check whether lazy loading needs to be triggered.
Rank #3
SaleLogitech C920x HD Pro Webcam, Full HD 1080p/30fps - Black w/Blue Yeti USB Microphone - Blackout- Webcam comes with a 3-month XSplit VCam license and no privacy shutter. XSplit VCam lets you remove, replace and blur your background without a Green Screen.
- Full HD 1080p video calling and recording at 30 fps - You’ll make a strong impression when it counts with crisp, clearly detailed and vibrantly colored video.
- Stereo audio with dual mics - Capture natural sound on calls and recorded videos.
- Custom three-capsule array: This professional USB mic produces clear, powerful, broadcast-quality sound for YouTube videos, Twitch game streaming, podcasting, Zoom meetings, music recording and more
- Blue VOICE software: Elevate your streamings and recordings with clear broadcast vocal sound and entertain your audience with enhanced effects, advanced modulation and HD audio samples
-
A full-page image is unwieldy. Use viewport capture for the visible screen or locator capture for the relevant section.
-
The output name is duplicated or unclear. Include a stable URL-derived identity or index, and add a run identifier when retaining multiple batches.
Crashes, 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 minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Saved state is exposed. Remove it from source control and restrict access; reusable cookies or headers can be sensitive.
Or skip the browser setup
ScreenshotNeo can return an image or PDF from one GET request. Its capture flow accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the page verdict and billing status in headers. It also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents.
Install requests with python -m pip install requests, set YOUR_API_KEY, and run this for each URL in your batch. See the ScreenshotNeo API documentation for request options.
Rank #4
- Compatible with Logitech C920x HD Pro Webcam, Full HD 1080p/30fps Video Calling. Compatible with Logitech C920 Hd Pro Webcam. Compatible with Logitech HD Pro Webcam C920 Widescreen Video Calling and Recording Webcam.
- Compatible with Logitech C930e Webcam. Compatible with Logitech C922 Pro Stream Webcam 1080P Camera for HD Video Streaming. Compatible with Logitech Privacy Cover for C920 and C930e.
- This webcam cover conveniently blocks your camera cover to protect your privacy.
- This also compatible with other popular webcams. This is also known as webcam lid, webcam cap, webcam protector, web camera privacy cover.
- ienza is a registered trademark and a registered Amazon brand. Use of the ienza trademark without the prior written consent of ienza, LLC. may constitute trademark infringement and unfair competition in violation of federal and state laws. ienza products are developed as cost-effective alternatives to OEM parts. They are not necessarily endorsed by the OEMs
import requests
urls = ['https://example.com', 'https://www.example.org']
for index, url in enumerate(urls, start=1):
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": url},
timeout=90,
)
r.raise_for_status()
with open(f"shot-{index:03}.webp", "wb") as f:
f.write(r.content)
ScreenshotNeo includes 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000. Try ScreenshotNeo free.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Frequently Asked Questions
Can one cookie-banner selector work across all sites?
No. Banner markup and control wording vary, so use a site-appropriate locator and verify the overlay has closed.
Does dismissing a banner always save consent for the next run?
No. Persistence depends on the target site’s implementation; verify its behavior rather than assuming a saved browser state covers it.
Should I use `networkidle` before taking every screenshot?
No. Use a meaningful page-specific readiness check; Playwright discourages `networkidle` as a generic test-readiness condition.
Quick Recap
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.
Recommended Free Tools




