Use a Node.js script with Playwright: install the package and its matching browser binaries, put the URLs in an array, then loop through them and save each page to a unique screenshot file. The example below runs captures sequentially in one browser context, uses a consistent viewport, and closes pages and the browser even if a capture fails.
Set up Playwright on Windows
-
Install a supported Node.js release. Playwright’s current installation documentation lists Node.js 22.x, 24.x, or 26.x and Windows 11 or Windows Server 2019 or later (also WSL). Because that is a
/next/documentation page and runtime requirements can change, confirm the current requirements before installation.As an Amazon Associate I earn from qualifying purchases.
-
Open PowerShell and create a project directory:
mkdir website-screenshots cd website-screenshots npm init -y -
Install Playwright and its browser binaries:
npm install playwright npx playwright installThe npm package alone is not enough; Playwright also needs its browser binaries. On Windows, the documented browser cache is
%USERPROFILE%AppDataLocalms-playwright. If you update Playwright, runnpx playwright installagain so the browser binaries match the installed package version. See the browser installation guide.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 minuteSpecial offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Create the output folder and a script file:
mkdir screenshots notepad capture.jsPaste the code in the next section into
capture.js, save it, and runnode capture.jsfrom the project directory.#1 Best Overall
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)- 14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
Capture a list of URLs sequentially
This complete example creates one browser context with a fixed viewport, opens a fresh page for each URL, saves a full-page PNG with a numbered filename, and closes resources in finally blocks. Create the screenshots directory before running it as shown above.
const { chromium } = require('playwright');
const path = require('node:path');
const urls = [
'https://example.com',
'https://playwright.dev',
];
(async () => {
const browser = await chromium.launch();
const context = await browser.newContext({
viewport: { width: 1440, height: 900 },
});
try {
for (const [index, url] of urls.entries()) {
const page = await context.newPage();
try {
await page.goto(url, { waitUntil: 'load' });
await page.screenshot({
path: path.resolve(
`screenshots/site-${String(index + 1).padStart(3, '0')}.png`
),
fullPage: true,
});
} finally {
await page.close();
}
}
} finally {
await context.close();
await browser.close();
}
})();
Run it with node capture.js. It writes site-001.png, site-002.png, and so on in the screenshots folder. The sequential loop is intentionally straightforward: it makes failures easier to associate with a URL and avoids starting a large number of pages at once.
Choose what each screenshot captures
Viewport or full page
By default, a screenshot captures the visible viewport. Set fullPage: true to capture the full scrollable page. Full-page images can be much taller and larger than viewport images; some sites also load content only after scrolling, so check whether the page’s lazy-loaded content appears as intended. The Page API documents the screenshot options.
PC 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 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchImage format and pixel scale
Playwright infers the output image type from the file extension. The screenshot API supports PNG, JPEG, and WebP; use a matching extension such as .png, .jpg, or .webp. The default scale is CSS, which produces one image pixel per CSS pixel. Device scale follows the device pixel ratio and may produce larger images. Choose a format and scale consistently if you plan to compare or archive captures.
Viewport consistency
The context’s viewport setting controls the page dimensions used in this example. Reusing one context carries the same context-level settings across its pages; Playwright’s Pages guide notes that a browser context can contain multiple pages. See Pages. Use a new context only when a particular URL needs different cookies, emulation, or other context-level settings.
Handle pages that are not ready at the load event
waitUntil: 'load' waits for the page load event, but it does not guarantee that every site-specific widget, client-rendered section, or delayed image has finished appearing. If a target page needs more time or a specific element, change the readiness condition for that site rather than adding an arbitrary long delay to every URL.
-
Wait for a known element: replace the navigation line with
await page.goto(url, { waitUntil: 'domcontentloaded' });, followed byawait page.locator('main').waitFor({ state: 'visible' });or a selector that is meaningful for that site.Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.Rank #2
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)- 256 GB SSD of storage.
- Multitasking is easy with 16GB of RAM
- Equipped with a blazing fast Core i5 2.00 GHz processor.
-
Wait briefly for a known delayed effect: after navigation, use
await page.waitForTimeout(1500);only when a short fixed pause is appropriate. A fixed delay can waste time on fast pages and still be too short on slow ones. -
Keep the input list controlled: only pass URLs you intend to visit. For URLs from a file or spreadsheet, validate them and preserve a stable order so output files remain traceable to their inputs.
Playwright’s rendering may differ across host operating systems, browser versions, settings, hardware, power source, and headless mode. For repeatable visual comparisons, keep those conditions and your viewport, scale, and capture options fixed; consult Playwright’s visual comparisons guidance.
Troubleshooting common failures
-
Playwright cannot find its browser executable: the package may be installed without its browser binaries, or the package may have been updated since they were installed. Run
npx playwright installfrom the project directory.What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
The script cannot write screenshots: confirm that the
screenshotsfolder exists and that the process has permission to write there. The example deliberately does not create the folder automatically. -
A navigation times out or fails: check the URL and network access, then determine whether the page is slow or requires a different readiness condition. Avoid treating a successful load event as proof that all dynamic content is ready.
-
The image is only the visible screen: confirm that the screenshot call includes
fullPage: true. Without it, Playwright captures the viewport.Rank #3
15.6 Inch Win 11 Laptop Computer, N4020, 4GB DDR4 RAM, 128GB Storage- WINDOWS 11 | STABLE PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 system, this laptop delivers stable performance for everyday computing tasks. It supports web browsing, online learning, document editing, email communication, and basic office work with optimized power efficiency, providing a practical and reliable experience for essential daily use for daily use.
- 15.6” FHD IPS DISPLAY: Features a 15.6-inch Full HD IPS display with narrow bezels, offering wider viewing angles and clearer image details compared to standard panels. The improved screen-to-body ratio enhances visual experience for study, reading, document work, and video playback, making it suitable for both productivity and entertainment use.
- 4GB DDR4 + 128GB eMMC STORAGE: Equipped with 4GB DDR4 memory and 128GB eMMC storage for everyday basics such as browsing, documents, email, and online learning platforms. The built-in TF card slot supports storage expansion up to 1TB, giving you more flexibility for files, photos, videos, and daily documents. TF card not included.
- CONNECTIVITY & PORTS: Includes 1× TF card slot, 2× USB 3.2 Gen1 ports, and 2× full-featured Type-C ports (USB 3.2 Gen1). The Type-C ports support data transfer, charging, and video output, enabling flexible connection with external devices such as monitors, storage, and peripherals for daily work and study use.
- LIGHTWEIGHT DESIGN | ONLINE COMMUNICATION: Designed with a slim, portable profile, this laptop is easy to carry for school, commuting, and travel. A built-in 1MP front camera supports online classes, video meetings, remote communication, and everyday conferencing. The 3300mAh battery works with the low-power system design to support practical daily use, while thermal optimization helps maintain quieter operation during extended tasks.
-
Images differ between runs or machines: rendering can vary with the operating system, browser version, hardware, settings, and headless mode. Keep the environment stable and compare captures made with the same dimensions and scale.
Recommended: Update Every Outdated Driver on Your PC in One Scan - Free →Recommended: Fix Windows Errors and Clear Junk Files in Minutes - Free Scan →Recommended: Crashes or Glitches? A Free Driver Scan Usually Finds the Culprit →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
One bad URL stops the batch: the
finallyblocks close the current page and browser resources, but this minimal script allows a navigation error to stop later URLs. To continue after an individual failure, add a per-URLcatcharound navigation and screenshot saving, log the URL and error, and leave the outer cleanup in place.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server: a GET request with a URL returns a PNG, JPEG, WebP, or PDF. It removes cookie and consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents and other MCP clients take screenshots, and it offers 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000.
For a single request from PowerShell, replace the target URL and API key in this cURL example. See the ScreenshotNeo API documentation for parameters and response details.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Frequently Asked Questions
Can one Playwright browser context capture several URLs?
Yes. A browser context can contain multiple pages, so the script can create and close a page for each URL while reusing the same context settings.
Does Playwright save screenshots as PNG only?
No. The screenshot API supports PNG, JPEG, and WebP; the output file extension determines the image type.
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.




