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

Use Bash to read the file one URL at a time, and use a browser tool such as Playwright to render and capture each page. For a small batch, the Playwright CLI can do this in a loop; for stable filenames and per-URL error handling, let Bash run a short Playwright script.

Prepare a URL file and output folder

Put one URL on each line in urls.txt. The example below ignores blank lines and lines whose first non-space character is #. It numbers captures so duplicate URLs still produce separate files.

https://example.com/
https://developer.chrome.com/
# This line is ignored
https://playwright.dev/

Install the Playwright CLI and its browser using the current Playwright CLI documentation. CLI commands and session behavior may vary with the installed version, so check its current instructions if a command differs.

Capture each URL with the Playwright CLI

Save this as capture.sh. It opens each URL and saves a viewport screenshot with a unique filename.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
#!/usr/bin/env bash
set -u

input=${1:-urls.txt}
outdir=${2:-screenshots}
mkdir -p -- "$outdir"
line_no=0

while IFS= read -r url || [[ -n $url ]]; do
  [[ -z ${url//[[:space:]]/} ]] && continue
  [[ $url =~ ^[[:space:]]*# ]] && continue

  name=$(printf 'page-%04d.png' "$((++line_no))")
  printf 'Capturing %s -> %s/%sn' "$url" "$outdir" "$name"
  playwright-cli open "$url"
  playwright-cli screenshot --filename="$outdir/$name"
done < "$input"

Run it with Bash, optionally passing an input file and output directory:

bash capture.sh urls.txt screenshots

The documented CLI workflow is playwright-cli open <url> followed by playwright-cli screenshot; it supports explicit filenames, full-page capture, and high-resolution options. This loop is a starting point rather than a guarantee for every CLI session configuration: adapt it to the installed CLI’s session lifecycle if opening a URL and capturing in separate commands do not share a session.

Rank #2
Dell Latitude 3190 11.6" HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
  • 1.1 GHz (boost up to 2.4GHz) Intel Celeron N5030 Quad-Core
  • 4GB DDR4 System Memory; 128GB Solid State Drive
  • 11.6" HD (1366 x 768) Multi-Touch Display
  • Combo headphone/microphone jack - Noble Wedge Lock slot - HDMI; 2 USB 3.1 Gen 1
  • Windows 11 Pro

Choose viewport or full-page capture

The default screenshot represents the visible viewport. For the full scrollable document, use the CLI’s --full-page option on the screenshot command. Full-page images can be very tall; use viewport captures when the initial screen is what you need to compare or archive.

Choose image format and resolution

The CLI supports PNG, JPEG, and WebP selection, plus a --hires option. Set the filename extension to the format you want, and consult the installed CLI’s help or documentation for the exact option syntax. PNG is lossless but often larger; JPEG and WebP can reduce file size, with format-specific quality trade-offs.

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

Use Playwright’s API for reliable batch control

For repeatable jobs, a small Playwright script is easier to extend than a CLI loop: it can launch one browser, capture URLs in sequence, name outputs predictably, report navigation failures per entry, and close the browser in a finally block. The following Node.js example uses Playwright’s Page API. Install Playwright and its browser according to the official installation guide.

const fs = require('node:fs/promises');
const { chromium } = require('playwright');

async function main() {
  const input = process.argv[2] || 'urls.txt';
  const outdir = process.argv[3] || 'screenshots';
  const text = await fs.readFile(input, 'utf8');
  const urls = text.split(/r?n/)
    .map(line => line.trim())
    .filter(line => line && !line.startsWith('#'));

  await fs.mkdir(outdir, { recursive: true });
  const browser = await chromium.launch();
  try {
    const page = await browser.newPage({ viewport: { width: 1280, height: 800 } });
    for (let i = 0; i < urls.length; i++) {
      const url = urls[i];
      const filename = `${outdir}/page-${String(i + 1).padStart(4, '0')}.png`;
      try {
        await page.goto(url, { waitUntil: 'load', timeout: 30000 });
        await page.screenshot({ path: filename, fullPage: false });
        console.log(`Saved ${url} -> ${filename}`);
      } catch (error) {
        console.error(`Failed ${url}: ${error.message}`);
      }
    }
  } finally {
    await browser.close();
  }
}

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

Run it with node capture.js urls.txt screenshots. The example continues after an individual navigation or screenshot error, while a failure to read the input or launch the browser is reported by the outer handler. Change fullPage to true for full-page captures, and change the viewport dimensions to suit the pages you are capturing. The Page API can infer image format from the output filename and supports CSS/device scale settings; see the Page API documentation.

Rank #4
15.6 Inch Laptop Computer, N4020, 4GB DDR4 RAM, 128GB eMMC,with Windows 11
  • EFFORTLESS EVERYDAY PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 Home system, delivering reliable, low-power efficiency for daily tasks like document editing, email, online classes, and web browsing
  • 15.6-INCH FULL HD DISPLAY: Enjoy immersive visuals on the 15.6" FHD (1920x1080) anti-glare screen with micro-edge bezels. Delivers clear details and comfortable viewing for long study sessions, working on spreadsheets, and video playback
  • RESPONSIVE MULTITASKING & STORAGE: Built with 4GB LPDDR4 RAM and 128GB eMMC storage for smooth daily essential use. Expand your storage by up to 1TB via the integrated TF card slot to easily store movies, photos, and working files
  • ADVANCED CONNECTIVITY: Outfitted with 2x Full-Featured Type-C ports for data transfer, fast charging, and dual-monitor output, alongside 2x USB 3.2 Gen1 ports and a 3.5mm audio jack for complete peripheral compatibility
  • LIGHTWEIGHT & SILENT OPERATION: Slim and portable for effortless travel or commuting. Features a 1MP HD webcam for remote meetings, 38Wh battery with 45W Type-C fast charging, and a fanless silent design for peaceful work environments.

Alternative: Chrome Headless

Chrome Headless can capture a single URL without a Playwright script:

chrome --headless --screenshot --window-size=412,892 https://developer.chrome.com/

Chrome documents that this writes screenshot.png in the current working directory. In a loop, that fixed filename would be overwritten by each URL, so direct each run to its own working directory or rename the resulting file before the next capture. For batches requiring per-URL naming and error recovery, the Playwright API approach is more straightforward.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make the batch consistent and manageable

  • Keep the environment fixed. Browser version, operating system, headless mode, hardware, viewport, and scale can affect rendered screenshots. Keep them consistent when captures are intended for comparison; Playwright discusses screenshot variability in its visual comparisons documentation.
  • Expect dynamic pages to differ. Animations, rotating content, delayed images, consent prompts, and personalized pages can change between runs. If consistency matters, decide what readiness condition and page state you need before taking each screenshot.
  • Plan for time and storage. Each URL needs a navigation and image write. Full-page captures may create large files, and a long URL list can take substantial time. Use a viewport, a compressed format, or smaller batches if output size or run time is an issue.
  • Preserve a useful mapping. Numbered output names are stable for a given file order, but not when lines are added or rearranged. For long-lived archives, adapt the script to derive safe filenames from a URL while handling duplicate paths and invalid filename characters.

Troubleshoot common failures

  • playwright-cli: command not found: the CLI is not installed or is not on the shell’s PATH. Follow the current CLI setup instructions and verify the command is available in the shell running the script.
  • Browser executable or launch error: install the Playwright browser required by your setup, or confirm that Chrome is installed when using Chrome Headless. Browser binaries are separate from the automation package in common Playwright installations.
  • Only one screenshot appears or later shots overwrite earlier ones: a command is reusing a fixed output name. Set an explicit unique filename for each Playwright CLI capture; with Chrome Headless, isolate or rename each default screenshot.png.
  • Navigation times out: the site may be slow, unreachable, or waiting on resources that do not finish. Check the URL and network access, then adjust the navigation timeout or choose an appropriate readiness condition for the site.
  • Image is blank or incomplete: the page may need more time or a specific element before capture. Use a suitable wait condition or wait for a selector in the API script; inspect the page in a browser to distinguish a capture issue from a page that did not render as expected.
  • Runs differ from one machine to another: align browser and operating system versions, viewport, scale, and headless settings. Differences in hardware and browser rendering can remain relevant even when the script is unchanged.

Or skip the browser setup

ScreenshotNeo accepts one GET request with a URL and returns an image or PDF, so you can process URLs without installing a local browser. For example, save the response for each URL in your own shell loop:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie banners are accepted and removed before capture, along with known newsletter popups and chat widgets; these cleanup steps can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. An MCP server provides screenshot tools for AI agents, and the free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to start capturing up to 1,000 screenshots a month with no card.

Frequently Asked Questions

Can the URL file contain Windows-style line endings?

Yes. The examples split on optional carriage returns before newlines or read lines with Bash, so standard CRLF line endings are accommodated.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Can I capture a specific element instead of the whole page?

Yes. Playwright’s Page API supports element screenshots; use the locator screenshot method when the output should be a particular component rather than the page viewport.

Quick Recap

Bestseller No. 1
HP 14' HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
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
$247.99
Bestseller No. 2
Dell Latitude 3190 11.6' HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
Dell Latitude 3190 11.6" HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
1.1 GHz (boost up to 2.4GHz) Intel Celeron N5030 Quad-Core; 4GB DDR4 System Memory; 128GB Solid State Drive
Bestseller No. 3
Dell Latitude 5420 14' FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
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.
$299.99

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.