Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Node.js, Puppeteer, and a CSV parser to read each URL, navigate to it, save a uniquely named screenshot, and log row-level failures so one bad page does not stop the batch. The example below processes URLs sequentially; choose a page-ready condition for your target sites rather than assuming network idle works everywhere.

What you need before you start

  • Node.js and npm.
  • A CSV file with a column named url.
  • Puppeteer and its compatible browser. Installing puppeteer normally downloads compatible Chrome; puppeteer-core does not download a browser. See the Puppeteer installation and overview documentation.
  • A CSV parser. Use a real parser if fields can contain commas, quotation marks, or line breaks; splitting each line on commas is not a reliable CSV parser.

Puppeteer is a JavaScript library for controlling Chrome or Firefox and runs headless by default. Its documented screenshot flow is to launch a browser, create a page, navigate, call Page.screenshot(), and close the browser.

Install the dependencies

For example, create a project and install Puppeteer plus the csv-parse package:

npm init -y
npm install puppeteer csv-parse

This example uses the parser’s synchronous API. If your package manager blocks dependency install scripts, the browser download may not happen; Puppeteer documents npx puppeteer browsers install as a manual browser-install path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#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

Prepare the CSV and output names

Save a header row named url. For example:

url
https://example.com
https://www.iana.org/domains/reserved

Each row needs a nonempty, valid HTTP or HTTPS URL. The script below derives filenames from row numbers, not URL text: this avoids collisions when URLs repeat and avoids unsafe characters in filenames. It writes screenshots to a screenshots directory and records one JSON object per input row in results.jsonl.

Run a sequential Puppeteer batch

Save the following as capture.js in the project directory. It continues after an invalid URL or a per-page navigation/capture failure, closes each page, and closes the browser when the job finishes.

const fs = require('node:fs');
const path = require('node:path');
const { parse } = require('csv-parse/sync');
const puppeteer = require('puppeteer');

const inputPath = process.argv[2] || 'urls.csv';
const outputDir = process.argv[3] || 'screenshots';
const resultsPath = path.join(outputDir, 'results.jsonl');
const timeoutMs = 30_000; // Example setting; adjust for your pages.
const waitUntil = 'networkidle2'; // Example readiness choice; see guidance below.

function validateUrl(value) {
  const trimmed = String(value ?? '').trim();
  if (!trimmed) throw new Error('URL is empty');

  let parsed;
  try {
    parsed = new URL(trimmed);
  } catch {
    throw new Error('URL is not valid');
  }

  if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
    throw new Error('URL must use http or https');
  }
  return parsed.href;
}

async function main() {
  const csvText = fs.readFileSync(inputPath, 'utf8');
  const rows = parse(csvText, {
    columns: true,
    skip_empty_lines: true,
    bom: true,
    trim: true,
  });

  fs.mkdirSync(outputDir, { recursive: true });
  fs.writeFileSync(resultsPath, '');

  const browser = await puppeteer.launch();
  try {
    for (let index = 0; index < rows.length; index++) {
      const row = rows[index];
      const rowNumber = index + 1;
      const outputPath = path.join(
        outputDir,
        `row-${String(rowNumber).padStart(5, '0')}.png`
      );
      let page;

      try {
        if (!Object.prototype.hasOwnProperty.call(row, 'url')) {
          throw new Error('CSV is missing the required "url" column');
        }
        const url = validateUrl(row.url);
        page = await browser.newPage();
        await page.goto(url, { waitUntil, timeout: timeoutMs });
        await page.screenshot({ path: outputPath, fullPage: true });
        appendResult({ row: rowNumber, url, status: 'success', output: outputPath });
      } catch (error) {
        appendResult({
          row: rowNumber,
          url: row.url ?? null,
          status: 'failed',
          output: null,
          error: error.message,
        });
      } finally {
        if (page) await page.close().catch(() => {});
      }
    }
  } finally {
    await browser.close();
  }
}

function appendResult(result) {
  fs.appendFileSync(resultsPath, `${JSON.stringify(result)}n`);
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

Run it with:

node capture.js urls.csv screenshots

The 30_000-millisecond timeout and networkidle2 setting are example choices, not universal recommendations. The script uses row-based paths, so rerunning it overwrites the corresponding row’s previous screenshot. The result log is also reset at the start of each run.

Choose when each page is ready

Puppeteer’s screenshot guide demonstrates navigation with waitUntil: 'networkidle2', but that is not a guarantee that every site is ready for capture. Pages may keep requests open, render important content later, or build the view client-side.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
HP 14" HD Chromebook Laptop for Students, Intel Quad-Core N4120(> N4020), 4GB RAM, 64GB eMMC, WiFi, Webcam, HDMI, USB-A&C, 14 Hours Battery Life, Zoom, Chrome OS, CUE Accessories
  • 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.
  • 14" HD Display: 14.0-inch diagonal, HD (1366 x 768), micro-edge, anti-glare. See your digital world in a whole new way. Enjoy movies and photos with the great image quality and high-definition detail of 1 million pixels.
  • Memory & Storage: 4 GB LPDDR4x & 64 GB eMMC Storage. Adequate high-bandwidth RAM to smoothly run multiple applications and browser tabs all at once. An embedded multimedia card provides reliable flash-based storage.
  • Ports:2 x USB 3.0 Type-A,1 x USB 3.0 Type-C,1 x HDMI,1 x Headphone Jack
  • Chrome OS: Chromebook is a computer for the way the modern world works, with thousands of apps. Enjoy the seamless simplicity that comes with Google Chrome and Android apps, all integrated into one laptop. It’s fast, simple, and secure.
  • Use a network-idle condition when it corresponds to how the target pages load and does not wait indefinitely on persistent activity.
  • For pages with a known content landmark, wait for a page-specific selector before taking the screenshot. This can be more meaningful than waiting for all network activity to quiet down.
  • For content that appears after a predictable delay, a delay may be appropriate, though it can waste time on fast pages and still be too short for slow ones.
  • Keep navigation and readiness timeouts finite, and log failures per row. A timeout means the script did not reach its selected condition within the configured interval; it does not prove the site is unavailable.

Choose and validate the readiness strategy against representative pages in your own CSV. The official guide documents an example, not a best setting for every website.

Choose the screenshot output

Page.screenshot() supports an output path and screenshot options. Its documented defaults are a viewport screenshot (fullPage: false) and PNG output. In the batch example, fullPage: true captures beyond the visible viewport.

Need Option to consider What to know
Capture the visible viewport Omit fullPage or set it to false This is the documented default.
Capture the full page fullPage: true Useful for long pages; output dimensions can be much larger than a viewport image.
Choose image format type PNG is the documented default. Supported lossy-format choices and behavior are described in the ScreenshotOptions documentation.
Set lossy-image quality quality Quality applies to supported lossy formats, not PNG.
Capture a region clip Specify a rectangular region rather than saving the entire page.
Capture a particular element ElementHandle.screenshot() The Puppeteer screenshots guide documents selected-element capture.

For the full option definitions, see the Page.screenshot() API and ScreenshotOptions interface.

Keep failures from stopping the batch

The per-row try/catch separates a bad URL or failed page from the rest of the CSV. Each result record includes a row number, input URL, status, output path on success, and error text on failure. The finally block closes the page even when navigation or screenshot capture throws; the outer finally closes the browser.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
AKCHART 15.6'' AI Laptop with Office 365 12GB RAM 256GB SSD Win 11 Laptops
  • 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.

Errors before the loop, such as an unreadable CSV or a browser that cannot launch, are job-level failures and stop processing. Check the process exit status and terminal output for those failures. The JSON Lines log is a simple implementation choice, not a batch feature built into Puppeteer.

Sequential processing, concurrency, and cost

Sequential processing is a useful first version because it keeps browser resource use and debugging straightforward. It can take longer when the CSV is large, but Puppeteer’s reviewed documentation does not publish a safe concurrency limit or throughput benchmark. If you add parallel pages, bound the number of simultaneous captures and measure runtime and resource use on representative target pages before increasing it.

Full-page screenshots and high-resolution pages can consume more memory and storage than viewport captures. Pick the format and capture area your downstream use needs; do not capture more pixels than necessary. Your local compute, browser runtime, and target-site behavior determine the practical cost and speed.

Troubleshooting

“Could not find Chrome” or a browser-launch error

puppeteer-core does not download Chrome, and some package managers block install scripts that would fetch the browser. Install compatible browser binaries with npx puppeteer browsers install, or use the full puppeteer package and verify its install step completed. Consult the installation documentation for the current setup guidance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
HP Essential Laptop 2026, Intel CPU, 128GB Storage, Office 365, Windows 11
  • 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.

A URL times out or never reaches network idle

The site may have long-lived requests, delayed content, or a navigation condition that does not match its rendering behavior. Try a page-specific selector or another appropriate readiness signal and adjust the timeout to your workload. Keep failures recorded per row rather than making one timeout halt the remaining URLs.

The screenshot is blank or missing content

The page may have captured before client-side content appeared, or the chosen condition may not represent the content you need. Wait for a meaningful selector or other page-specific readiness signal, then inspect the result on representative pages. A successful navigation alone does not establish that every desired element has rendered.

Later rows are not processed after one failure

Keep validation, navigation, and screenshot work inside the per-row try/catch. Ensure cleanup is in finally so one failed page does not leak an open page or prevent browser shutdown.

Rows are skipped, malformed, or produce odd URLs

Confirm the CSV header is exactly url, values are trimmed, and a proper parser is used for quoted fields and embedded newlines. The sample parser skips empty lines; invalid or empty URL values are logged as failed rows.

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.
Best Value
Sale
HP 14‘’ Laptop, 2027 Edition, Intel N150 CPU, 4GB RAM, 128GB SSD, Copilot AI, 1TB Cloud Storage, Win 11 with Microsoft 365
  • Designed for mobility with a slim 0.71-inch profile and lightweight, making it easy to carry between home, office
  • 【Versatile Connectivity】Stay connected with multiple ports including USB 3.0 Type-C, USB 3.0 Type-A, HDMI, and a headphone/mic combo jack, with Wi-Fi and Bluetooth for seamless wireless networking.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo offers a website screenshot API and MCP server. One GET request returns an image or PDF; the example below saves a screenshot of the target URL. See the ScreenshotNeo API documentation for request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.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 of those steps can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses include X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month without a card.

Frequently Asked Questions

How do I take full-page screenshots?

Set fullPage: true in the options passed to page.screenshot().

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I keep one failed URL from stopping the batch?

Handle validation, navigation, and screenshot errors inside a per-row try/catch, then close the page in finally.

Why is Puppeteer missing Chrome after install?

The browser download may not have run, or you may have installed puppeteer-core, which does not download Chrome. Use the documented browser-install command or install the full package with its install scripts enabled.

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.