Put one URL on each line of a text file, then run Chrome headless once per non-empty line and give every capture its own output filename. Chrome’s --screenshot option saves a PNG; by default, it writes screenshot.png in the current working directory, so a batch needs explicit filenames to avoid overwriting earlier images. See the Chrome Headless command-line reference.
Prepare the URL list and output folder
Create urls.txt with one complete URL per line, for example:
https://example.com/
https://developer.chrome.com/
Create the output folder before running the loop. From a Unix-like shell:
mkdir -p screenshots
Use a Chrome executable available on your system. The examples below use chrome; an installation may instead expose google-chrome or require a platform-specific executable path. Confirm the command and test against a single URL before processing a larger list.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Capture each URL with Chrome headless
Run this in a Unix-like shell from the directory containing urls.txt. It skips empty lines and numbers the resulting PNG files so each URL gets a distinct name.
n=0
while IFS= read -r url || [ -n "$url" ]; do
[ -z "$url" ] && continue
n=$((n + 1))
chrome --headless --screenshot="screenshots/page-$n.png"
--window-size=1280,900 --timeout=10000 "$url"
done < urls.txt
The official reference documents --headless --screenshot, a viewport set with --window-size=WIDTH,HEIGHT, and --timeout in milliseconds. Its example is chrome --headless --screenshot --window-size=412,892 https://developer.chrome.com/. Without an explicit output path, Chrome writes screenshot.png in the current working directory.
What the command does
IFS= read -rreads each line without trimming or interpreting backslashes.|| [ -n "$url" ]processes a final line even if the file does not end with a newline.- The empty-line check prevents Chrome from being called with a blank URL.
--screenshot="screenshots/page-$n.png"assigns each capture a different filename.--window-size=1280,900sets the capture viewport dimensions; it does not establish that the whole page will be captured.--timeout=10000sets a maximum wait of 10,000 milliseconds before capture, even if the page is still loading. It is not proof that rendering is complete.
Choose output names and capture timing deliberately
Keep names unique
The numbered filenames are simple and safe, but their numbers depend on the order of lines in the input. If you need filenames tied to URLs, derive them from the hostname or path only after sanitizing them: raw URLs can contain characters that are unsafe or awkward in filenames. Do not use the full URL as a filename unchanged.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Set the viewport for the intended result
Change the width and height in --window-size to match the viewport you want to inspect. The documented basic screenshot command does not establish a dedicated full-page capture option, so treat this method as a viewport screenshot rather than a guarantee of a complete page image.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Allow for dynamic pages
--timeout bounds the wait; a page may still be loading or may not have exposed all lazy-loaded content when that time expires. Chrome also documents --virtual-time-budget for fast-forwarding time-dependent page code. Whether that produces the desired state depends on how the page behaves; use a representative URL to check the result.
Adapt the workflow to your shell and site
The loop shown here is for a Unix-like shell, not a universal Chrome batch interface. On Windows, use PowerShell or another shell’s line-reading loop, and quote both the Chrome executable path and URL argument according to that shell’s rules. In any environment, the core pattern is the same: read one URL, invoke Chrome, and choose a unique output path for that invocation.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
A successful command does not guarantee that every site will produce the expected screenshot. Redirects, authentication requirements, automated-traffic blocking, and different rendering in a headless session can affect the result. The command-line reference documents the options, not a promise that every URL is capturable.
Troubleshoot common problems
Chrome says the command is not found
The executable name may differ on your operating system or the Chrome binary may not be on the shell’s PATH. Check the installed executable and use its actual name or full path in the loop.
Outdated 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 matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallEvery run overwrites the same image
If you omit the screenshot output path, Chrome uses screenshot.png in the current working directory. Set a unique path for each invocation, as in screenshots/page-$n.png, and ensure the output directory exists.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
The screenshot looks incomplete or blank
The timeout may be too short for the page, or the site may require authentication, redirect, block automation, or render differently in headless mode. Try a suitable timeout and inspect one URL directly before rerunning the whole file. A timeout does not certify that the page has finished rendering.
A URL is treated as multiple shell arguments
Keep the URL quoted as "$url". If you substitute a different shell or build a command in another script, use that environment’s correct quoting rules.
The output folder cannot be used
Create screenshots before starting the loop and confirm that the current user can write to it. The example does not create that directory automatically.
Recommended Free Tools
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Or skip the browser setup
ScreenshotNeo can capture a URL with one GET request and return PNG, JPEG, WebP, or PDF. Its capture flow accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response includes X-Page-Verdict and X-Billed headers.
For a single URL, use cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Replace YOUR_API_KEY with your key and change the target URL. See the ScreenshotNeo API documentation for the available parameters. Its MCP server also provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots a month without a card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.
Frequently Asked Questions
Does this loop create a PDF?
No. The Chrome command shown captures PNG screenshots.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsQuick Recap
Can I use a blank line between URLs?
Yes. The loop skips empty lines.
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.

