Use Node.js to read and validate each CSV row, navigate to its URL with Puppeteer, save the page to a unique filename, and log failures without stopping the rest of the batch. The example below runs sequentially so it is straightforward to debug; choose the page-readiness condition for your sites rather than assuming one setting works everywhere.
What the script does
Puppeteer’s documented screenshot workflow is to launch a browser, create a page, navigate, call Page.screenshot(), and close the browser. Puppeteer is a JavaScript library for controlling Chrome or Firefox and runs headless by default. Its screenshot guide demonstrates waitUntil: 'networkidle2' and page.screenshot({ path: 'hn.png' }), but that example is not a universal readiness rule. See the Puppeteer screenshots guide.
As an Amazon Associate I earn from qualifying purchases.
CSV parsing, URL validation, output naming, per-row error handling, and deciding how many pages to process at once belong to the batch script around Puppeteer; Puppeteer’s screenshot guide does not provide a CSV batch runner.
Free tools Windows power users keep installed
One-click scans. No signup required.
Install Node.js, Puppeteer, and a CSV parser
-
Install Node.js if it is not already available in your environment.
#1 Best Overall
HP OmniBook 3 17.3 inch Laptop PC, FHD Display, AMD Ryzen 3 30, 8 GB RAM, 512 GB SSD, AMD Radeon 610M Graphics, Windows 11 Home, Mica Silver, 17-dp0199nr- FULL HD IPS DISPLAY - Enjoy vibrant, crystal-clear images with 178-degree wide-viewing angles
- AMD RYZEN 3 30 PROCESSOR - Everyday performance you can count on; Multitask, stream, game casually, and edit photos smoothly with responsive power and vibrant HDR visuals
- ENJOY UP TO 14 HOURS AND 15 MINUTES OF BATTERY LIFE - HP Fast Charge restores battery from 0 to 50% in approximately 45 minutes
- AMD RADEON 610M GRAPHICS - Experience smooth entertainment; Built for streaming and multitasking, enjoy realistic visuals and efficient performance for work and play
- STORAGE AND MEMORY - 512 GB PCIe NVMe M.2 SSD offers fast speed and efficient storage; and 8 GB LPDDR5 RAM memory boosts performance with higher bandwidth
-
Create a project and install Puppeteer and a CSV parser. This example uses the
csv-parsepackage’s synchronous API:mkdir csv-screenshots cd csv-screenshots npm init -y npm install puppeteer csv-parseThe CSV parser is a separate dependency, not a Puppeteer feature.
-
By default,
npm i puppeteerdownloads a compatible Chrome during installation.puppeteer-coredoes not download Chrome. If your package manager blocks dependency install scripts, the browser download may not happen; Puppeteer documentsnpx puppeteer browsers installas a manual installation path. Check the Puppeteer installation and overview documentation if launch reports a missing browser.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. -
Save your input as
urls.csvwith a header namedurl, for example:url https://example.com https://www.wikipedia.org
Save and run the batch script
Create capture.js in the project directory. The script expects a header row and a url column. It writes PNGs into screenshots/ and a CSV report to results.csv. Rows with invalid or missing URLs are reported and skipped; a navigation or screenshot failure for one valid URL does not stop later rows.
const fs = require('node:fs');
const path = require('node:path');
const { parse } = require('csv-parse/sync');
const puppeteer = require('puppeteer');
const inputPath = path.resolve('urls.csv');
const outputDir = path.resolve('screenshots');
const reportPath = path.resolve('results.csv');
const timeoutMs = 30_000; // Example choice; tune for the pages you capture.
function csvCell(value) {
const text = String(value ?? '');
return `"${text.replaceAll('"', '""')}"`;
}
function validateUrl(value) {
const trimmed = String(value ?? '').trim();
if (!trimmed) throw new Error('Missing URL');
let parsed;
try {
parsed = new URL(trimmed);
} catch {
throw new Error('Invalid URL');
}
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
throw new Error('URL must use http or https');
}
return parsed.href;
}
async function main() {
if (!fs.existsSync(inputPath)) {
throw new Error(`Input CSV not found: ${inputPath}`);
}
fs.mkdirSync(outputDir, { recursive: true });
const records = parse(fs.readFileSync(inputPath, 'utf8'), {
columns: true,
skip_empty_lines: true,
trim: true,
bom: true,
});
const report = [['url', 'output_path', 'status', 'error'].map(csvCell).join(',')];
let browser;
try {
browser = await puppeteer.launch();
for (let index = 0; index < records.length; index++) {
const row = records[index];
const rawUrl = row.url ?? '';
let outputPath = '';
let page;
let status = 'failed';
let errorText = '';
try {
const url = validateUrl(rawUrl);
// Index-based names stay unique even when a URL appears more than once.
outputPath = path.join(outputDir, `shot-${String(index + 1).padStart(5, '0')}.png`);
page = await browser.newPage();
await page.goto(url, {
waitUntil: 'networkidle2',
timeout: timeoutMs,
});
await page.screenshot({ path: outputPath, fullPage: true });
status = 'success';
} catch (error) {
errorText = error instanceof Error ? error.message : String(error);
// A failed capture may leave a partial file; remove it so it is not mistaken for success.
if (outputPath && fs.existsSync(outputPath)) {
fs.rmSync(outputPath, { force: true });
}
} finally {
if (page) {
try {
await page.close();
} catch (error) {
if (!errorText) errorText = `Page cleanup failed: ${error.message}`;
if (status === 'success') status = 'failed';
}
}
}
report.push([rawUrl, outputPath, status, errorText].map(csvCell).join(','));
console.log(`${status}: ${rawUrl}${errorText ? ` — ${errorText}` : ''}`);
}
} finally {
if (browser) await browser.close();
}
fs.writeFileSync(reportPath, `${report.join('n')}n`, 'utf8');
console.log(`Report written to ${reportPath}`);
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Run it with:
node capture.js
The 30_000 ms timeout is an example configuration, not a Puppeteer standard. The script writes its report after the loop completes; a process termination before then can prevent the report from being saved.
Rank #2
- Intel Celeron N4120: 4 Cores & Threads, 1.1GHz Base Clock, Up to 2.6GHz Boost Clock, 4MB Cache, Intel UHD Graphics 600. The perfect combination of performance, power consumption, and value helps your device handle multitasking smoothly and reliably with four processing cores to divide up the work.
Choose readiness for the pages you capture
The guide’s example uses networkidle2, which can be useful for pages that settle after their requests finish. It may be a poor fit for sites with long-lived requests, delayed content, or client-side rendering. Navigation success alone also does not prove that a particular element or image is ready.
- Use a network-idle condition when the target page’s network activity settles reliably. If it times out repeatedly, inspect whether the site keeps requests open or continually fetches data.
- Wait for a selector when a known page element signals that the content you need has rendered. After navigation, use a page-specific selector wait, with a timeout that matches the target site.
- Use a delay only deliberately when you have a known timing requirement that is not better represented by a selector or network condition. A fixed delay can waste time on fast pages and still be too short on slow ones.
There is no single best wait condition for every website. Change the navigation/readiness logic to match the pages in your CSV and record the resulting failures so you can identify URLs that need different handling.
Choose the screenshot output
Page.screenshot() supports a path, full-page capture, output type, quality, clipping, and transparent background. The documented defaults are viewport-only capture (fullPage: false) and PNG output. Consult the Page.screenshot() API and the ScreenshotOptions documentation for the available options and types.
| Need | Option | What to know |
|---|---|---|
| Capture beyond the visible viewport | fullPage: true |
The documented default is false. Full-page capture can produce much taller images than viewport capture. |
| Choose an image format | type |
PNG is the documented default. Other supported lossy formats can reduce file size; check the API documentation for supported values in your installed version. |
| Trade image quality for size | quality |
Quality applies to supported lossy formats, not PNG. |
| Capture a region | clip |
Specify a rectangular clip instead of capturing the entire page area. |
| Capture one element | Element handle screenshot | The guide documents ElementHandle.screenshot() for capturing a selected element rather than the whole page. |
For an element capture, wait for the target element and use its handle’s screenshot method. Make sure the selector identifies the intended element on every page; templates can differ across URLs.
Keep failures isolated and filenames safe
Validate before navigation
Trim each cell and reject empty values, malformed URLs, and schemes other than HTTP or HTTPS before calling page.goto(). This catches bad rows early and avoids treating arbitrary protocols as website addresses.
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 minuteUse unique output paths
The example names files by row position, not by URL. That avoids collisions when the CSV contains the same URL more than once and avoids unsafe characters from URL paths in filenames. If you use slugs or hostnames instead, sanitize them and still add a unique suffix.
Rank #3
- Stunning 15.6" FHD IPS Display: Experience crisp 1920x1080 resolution on this 15.6 inch laptop with an IPS panel that delivers wide viewing angles and vivid colors. The narrow-bezel design maximizes screen real estate for comfortable viewing on this Win 11 laptop, whether you're studying or working.
- Celeron J4105 Processor & 256GB SSD: Powered by a reliable Celeron J4105 processor paired with 12GB DDR4 memory and a fast 256GB M.2 SSD. This laptop computer supports SSD expansion up to 2TB and TF card expansion up to 1TB, so your storage grows with your needs. Delivers smooth multitasking for daily productivity.
- AI-Powered Win 11 Laptop: Built-in AI features enhance your productivity with smart assistance for writing, summarizing, and task management. Pre-installed with Win 11 and includes Office 365 subscription. This student laptop is backed by 1-year warranty and 24/7 customer support.
- All-Day 7000mAh Battery & 180° Hinge: The high-capacity 7000mAh battery keeps this laptop powered through long classes or meetings. The 180-degree lay-flat hinge lets you share your screen effortlessly during presentations. This durable laptop computer adapts to your dynamic workflow.
- Versatile Connectivity Hub: Equipped with USB 3.2, Type-C, Mini HDMI, and 3.5mm audio jack to connect all your peripherals. Stay online anywhere with high-speed 5G WiFi and Bluetooth 4.2. This college laptop keeps you connected at home, in the library, or on the go.
Catch errors per row and close resources
The per-row try/catch/finally records a failure and closes that row’s page before continuing. The outer finally closes the browser even if the job encounters a fatal error. These are batch-script reliability measures, not a built-in Puppeteer CSV feature.
Sequential processing, concurrency, and cost
The example opens one browser and processes one row at a time. That makes resource use and debugging easier to reason about, but total job time grows with the number of URLs and each page’s load time. Puppeteer’s reviewed documentation does not establish a safe concurrency setting or a throughput benchmark.
If sequential processing is too slow, add bounded concurrency only after measuring representative pages in your environment. More simultaneous pages can increase CPU and memory use and may expose network or target-site limits. Do not assume a particular number of workers will be safe for every machine or site. Track runtime, failures, and output size as you tune it.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Troubleshooting
“Could not find Chrome” or browser launch fails after installation
Cause: The browser download may not have run, particularly if package installation scripts were blocked, or you installed puppeteer-core, which does not download Chrome.
Fix: Use puppeteer if you want its compatible Chrome download, or install a browser using the documented npx puppeteer browsers install path and configure the runtime appropriately. See the installation documentation.
A URL fails while later URLs should still run
Cause: A malformed URL, navigation error, timeout, or screenshot error can affect that row.
Rank #4
- Efficient Performance for Everyday Computing: Powered by Intel N150 processor with up to 3.6 GHz Intel Turbo Boost Technology, 6 MB L3 cache, 4 cores, and 4 threads, this HP laptop delivers responsive performance for web browsing, streaming, document editing, and multitasking. Paired with 4GB LPDDR5 RAM and 128GB UFS storage, it handles daily tasks smoothly. Includes 1-year Microsoft 365 Personal subscription for Word, Excel, PowerPoint, and cloud storage to maximize your productivity.
- 14-Inch HD Micro-Edge Display:Enjoy clear visuals on the 14-inch HD (1366 x 768) anti-glare screen with 250-nit brightness and 62.5% sRGB coverage. The micro-edge bezel delivers a 79% screen-to-body ratio in a compact design. An HP True Vision 720p HD camera with noise reduction and dual-array microphones supports clear video calls, remote work, and online learning.
- Modern Connectivity and Wireless Technology: Stay connected with Wi-Fi 6 (2x2) for faster wireless speeds and Bluetooth 5.4 for seamless pairing with accessories. Versatile port selection includes 1 USB Type-C 10Gbps with DisplayPort 1.2 for external displays, 2 USB Type-A 5Gbps ports for peripherals, 1 HDMI 1.4b port, 1 headphone/microphone combo jack, and 1 multi-format SD media card reader. Connect monitors, transfer files quickly, and expand your workspace with ease.
- All-Day Battery Life and Portable Design: Enjoy up to 11 hours of video playback, 7.5 hours of mixed usage, or 7.5 hours of wireless streaming on a single charge, perfect for students and professionals on the go. Weighing just 3.24 lb and measuring 12.76" x 8.86" x 0.71", this lightweight laptop fits easily in backpacks and bags. The stylish willow green top cover with matte finish and natural silver keyboard deck with vertical brushing pattern offer a modern, professional look.
- AI-Enhanced Productivity: Access Microsoft Copilot instantly with the dedicated Copilot key for faster assistance. AI Noise Reduction filters background sounds and improves voice clarity during calls. Dual speakers provide clear audio, while the full-size natural silver keyboard and HP Imagepad support comfortable typing and navigation.
Fix: Keep navigation and capture inside the per-row try/catch, report the URL and error, close the page in finally, and continue the loop. If the browser itself cannot launch, the job cannot capture any rows.
Navigation times out on a page that appears to load
Cause: The selected readiness condition may not be reached, for example because a page maintains requests or keeps rendering content after initial navigation.
Fix: Choose a readiness signal suited to the target page, such as a selector that marks the content you need. Adjust the timeout based on observed behavior rather than assuming one wait setting fits all sites.
The image is only the visible viewport
Cause: The documented default for fullPage is false.
Fix: Pass fullPage: true when you want a full-page image, as in the example.
Two captures overwrite each other
Cause: The output naming rule generated the same path for multiple rows.
Best Value
- 【Expansive Display】The 14 Non-touch display offers clear, and anti-glare coating, perfect for both work and entertainment.
- Designed for mobility with a slim 0.71-inch profile and lightweight, making it easy to carry between home, office
- 【Versatile Connectivity】 connected with multiple ports including USB 3.0 Type-C, and a headphone/mic combo jack, with Wi-Fi and Bluetooth for seamless wireless networking.
- One Year Microsoft 365
Fix: Include a unique row index or another collision-resistant suffix. The example uses a zero-padded row index, so duplicate URLs still receive separate files.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server for developers. One GET request can return a screenshot or PDF; the following example saves a screenshot for one URL. Replace the example URL with the page you need to capture. See the ScreenshotNeo API documentation for request parameters and setup.
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 and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and each response identifies the page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. For a CSV batch workflow, you would still need to call the API for each URL or build your own batching around it.
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 & 11Crashes, 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 minuteSign up for ScreenshotNeo free: 1,000 screenshots a month with no card.
Frequently Asked Questions
How do I take full-page screenshots?
Pass fullPage: true to page.screenshot(); the documented default captures only the viewport.
Why is Puppeteer missing Chrome after install?
The install script may have been blocked, or you may have installed puppeteer-core, which does not download Chrome. The Puppeteer installation documentation describes a manual browser-install path.
How do I keep one failed URL from stopping the batch?
Catch navigation and screenshot errors inside the loop for each row, record the failure, close that page in a finally block, and continue.
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.




