The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →To convert multiple HTML pages to PNG, render each page in a browser and save a screenshot to its own file. Playwright’s screenshot API handles the capture for each page; your script supplies the batch loop, input handling, filenames, and any retry or concurrency policy. A PNG reflects the rendered page at a chosen size and state—it is not a direct conversion of HTML source text.
What bulk HTML-to-PNG conversion does
HTML describes a page; a browser lays it out, applies CSS, runs JavaScript, and loads assets. Capturing that rendered browser page produces the PNG. The result therefore depends on the browser, viewport, device scale, page state, and whether content has finished loading.
Playwright documents navigation and page screenshots, including output paths and capture options. Its screenshot documentation describes per-page operations, not a dedicated bulk-conversion command, universal throughput limit, or performance guarantee. The batch behavior below is implemented by iterating over your inputs.
Choose what each PNG should contain
- Viewport: captures the visible browser area. Choose this for consistent, screen-sized images.
- Full page: captures the full scrollable document. This can create very tall images, and pages that load content only while scrolling may need extra handling.
- Element: captures a selected page component, such as a chart or card, rather than the whole page. Playwright documents element screenshots.
For a repeatable batch, keep the viewport and capture settings consistent. CSS-pixel scale produces one image pixel per CSS pixel; device scale follows the device pixel ratio and can create larger images. Transparent backgrounds are supported for PNG, not JPEG. Playwright also documents controls for animations and screenshot styles that can help hide dynamic page elements. Browser and host-environment differences can still change visual output.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Convert a list of HTML files with Playwright
This Node.js example launches Chromium, opens each local HTML file, waits for the page load event, and writes one full-page PNG per input. It creates a separate output directory and uses each input filename as the PNG name. Install Playwright and its Chromium browser before running it:
- Install Node.js, then run
npm init -yin a new project folder. - Install Playwright with
npm install playwright. - Install Chromium with
npx playwright install chromium. - Save the following script as
convert.mjs, then run it withnode convert.mjs.
The example expects files in an input directory beside the script. It captures PNGs into output. Adjust the input and output directory paths for your project.
import { chromium } from 'playwright';
import { mkdir, readdir } from 'node:fs/promises';
import path from 'node:path';
import { pathToFileURL } from 'node:url';
const inputDir = path.resolve('input');
const outputDir = path.resolve('output');
const viewport = { width: 1440, height: 900 };
await mkdir(outputDir, { recursive: true });
const files = (await readdir(inputDir))
.filter((name) => name.toLowerCase().endsWith('.html'))
.sort();
const browser = await chromium.launch();
try {
for (const file of files) {
const inputPath = path.join(inputDir, file);
const outputPath = path.join(outputDir, `${path.parse(file).name}.png`);
const page = await browser.newPage({ viewport });
try {
await page.goto(pathToFileURL(inputPath).href, { waitUntil: 'load' });
await page.screenshot({ path: outputPath, type: 'png', fullPage: true });
console.log(`Saved ${outputPath}`);
} catch (error) {
console.error(`Failed ${inputPath}:`, error);
} finally {
await page.close();
}
}
} finally {
await browser.close();
}
The code uses a fresh page for each file and closes it whether capture succeeds or fails. Failed inputs are logged while the loop continues. If you need the whole batch to fail when any item fails, collect failures and set a nonzero process exit code after the loop instead of only logging them.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Capture remote HTML pages instead
For a list of web URLs, replace file navigation with URL navigation. Use stable, unique output names rather than deriving a local filename from an arbitrary URL. For example, keep a separate input record with a safe ID for each URL, then save to ${id}.png. Avoid using raw URL text as a path: slashes, query strings, and duplicate URLs can produce invalid or colliding filenames.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
const jobs = [
{ id: 'home', url: 'https://example.com/' },
{ id: 'about', url: 'https://example.com/about' },
];
for (const job of jobs) {
const page = await browser.newPage({ viewport });
try {
await page.goto(job.url, { waitUntil: 'load', timeout: 30_000 });
await page.screenshot({ path: path.join(outputDir, `${job.id}.png`), fullPage: true });
} finally {
await page.close();
}
}
Use this for pages you are authorized to access. If a site requires authentication, provide the appropriate session or credentials securely; do not place secrets in source files that may be committed.
Control page state and output
Wait for the right point in rendering
waitUntil: 'load' waits for the page load event, but it does not prove that every application has finished asynchronous work. If a page renders important content after load, wait for a selector that indicates readiness before taking the screenshot. A fixed delay can be a fallback for known timing behavior, but it is less robust than a page-specific readiness condition. Network-idle behavior can also be inappropriate for pages with persistent requests.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Set dimensions and scale deliberately
Set a fixed viewport for every job when screenshots need matching dimensions. Use CSS scale when the CSS-pixel layout size is the target; use device scale when higher-density output is needed. Remember that device-scale images use more pixels and may take more storage. For full-page captures, image height varies with document length even when viewport width and height are fixed.
Reduce visual noise
Animations, rotating content, timestamps, and personalized widgets can make repeated captures differ. Playwright’s screenshot options include animation control and screenshot styles; use them where appropriate to disable motion or hide known dynamic elements. Keep the browser version, operating system, fonts, and relevant page data stable for visual comparisons. Screenshot settings alone cannot eliminate differences caused by a changed host environment or live website.
Handle local assets and dependencies
A local HTML file may refer to images, fonts, stylesheets, or scripts through relative paths. Keep those assets available at the expected paths. If the page’s scripts rely on web security behavior, server routes, or fetch requests, opening the file directly may not reproduce its normal environment; serve the files locally and navigate to the local server URL in that case.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Scale a batch without losing control
For a modest list, sequential capture is simple and limits browser resource use. For larger jobs, concurrency can reduce total elapsed time but increases memory, CPU, and network demand. Neither Playwright’s screenshot API nor the reviewed official documentation establishes a universal safe concurrency value or batch throughput. Start with a small number of workers, observe resource use and failure rates on your own pages, and adjust.
- Give each input a stable ID and each output a unique filename.
- Log the input, output path, error, and attempt number for each job.
- Retry transient failures selectively, with a finite retry count; do not retry permanent navigation or content errors indefinitely.
- Keep completed outputs separate from failed jobs so a rerun need not overwrite successful results unnecessarily.
- For very large batches, process inputs in chunks and close pages or browser contexts promptly.
These are job-runner design choices around the documented per-page capture operation, not a claim that Playwright provides a built-in bulk service.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting common failures
- No PNG files appear: Confirm the input directory exists, contains files ending in
.html, and that the script is running from the intended working directory. Check that the output directory is writable. - Chromium fails to launch: Run
npx playwright install chromiumand check that the runtime environment permits browser processes. In restricted containers, browser dependencies or process permissions may also be missing. - The PNG is blank or incomplete: Confirm the page loads in the browser and that required assets are reachable. Wait for the specific content selector or application-ready state before capture.
- Images or fonts are missing: Check relative asset paths, network access, and whether the page expects to be served over HTTP rather than opened as a local file.
- Output files overwrite each other: Use unique IDs or preserve relative directory structure in output names. Two inputs with the same basename need distinct destinations.
- Full-page output is unexpectedly tall: Full-page capture includes the scrollable document, not just the viewport. Use viewport capture when that is the intended format, or inspect the source page for oversized content.
- Repeated captures do not match: Stabilize viewport, browser and host environment; wait for a meaningful readiness condition; control animations and dynamic elements; and account for personalized or live content.
- The batch slows or crashes: Reduce concurrent pages, process in chunks, and close pages after capture. Very large full-page images consume more memory and storage than viewport shots.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. For a remote URL, a single GET request can return a PNG, JPEG, WebP, or PDF. For local HTML files, serve the files at reachable URLs first; this endpoint takes a URL rather than uploading a local file. See the ScreenshotNeo API documentation for available parameters and options.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
It can remove cookie or consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. An MCP server provides screenshot tools for AI agents. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month, with no card required.
Choose between local automation and an API
Use a local Playwright workflow when your inputs are files on your machine, you need browser-level control, or page data should stay within your own environment. A hosted screenshot API can suit remote URLs when you prefer a managed capture request. Compare the actual input requirements, page-state controls, output delivery, privacy needs, throughput behavior, and total cost for your workload. The available Playwright documentation establishes capture options, but not a provider-by-provider comparison or commercial service limits.
Frequently Asked Questions
Can Playwright convert an HTML file directly into a PNG without opening a browser?
No. It captures the browser-rendered page, so HTML must be loaded and rendered before the screenshot is saved.
Can I capture only one element rather than the full page?
Yes. Playwright documents element screenshots; locate the element and use its screenshot operation instead of capturing the page.
Recommended Free Tools
Does Playwright impose a documented bulk-conversion limit?
The cited screenshot documentation describes per-page capture, not a universal bulk limit or throughput guarantee.
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.

