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 →Query the rows you want, pair each URL with a stable database ID, and use a single Puppeteer browser with a small number of page workers to save one uniquely named screenshot per row. This Node.js example uses SQLite for a runnable database workflow; replace the query and driver with your database’s equivalent while keeping the validation, bounded concurrency, and per-row results.
What the batch needs to do
Puppeteer’s documented capture primitive is Page.screenshot(): navigate a page, then save the image. For a database batch, keep selection and capture as distinct steps. Select a stable row ID with each URL, validate URLs before navigation, and never use a raw URL as a local filename. Reuse one browser, limit the number of pages active at once, and record each row’s outcome independently.
As an Amazon Associate I earn from qualifying purchases.
The example below assumes a SQLite table named pages with numeric id and text url columns. It writes PNG files under screenshots/ and continues when an individual page fails.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Install Puppeteer and SQLite
The puppeteer package downloads a compatible Chrome during installation. Use it when the deployment environment can install and run that browser. puppeteer-core does not download a browser; choose it only when your environment separately manages the browser executable or connection. If installation scripts were blocked by a package manager, the expected browser may be missing at runtime; check the current Puppeteer installation guide.
#1 Best Overall
- Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM)
- Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
- CanaKit Turbine Black Case for the Raspberry Pi 5
- CanaKit Low Noise Bearing System Fan
- Mega Heat Sink - Black Anodized
npm install puppeteer better-sqlite3
Create a SQLite database with a table such as:
CREATE TABLE pages (
id INTEGER PRIMARY KEY,
url TEXT NOT NULL
);
Insert the target rows using your application’s normal database workflow. The screenshot script uses a parameter-free read query here because it processes all rows; if the batch should be restricted, use a parameterized query with the appropriate IDs or conditions rather than concatenating user input into SQL.
Run a bounded Puppeteer batch
Save this as capture.js. It reads rows in ID order, checks that each URL is HTTP or HTTPS, names each file from the database ID, and starts no more than CONCURRENCY page jobs at once. The concurrency setting is an example, not a universal safe limit; tune it for the machine, browser, and target sites.
Rank #2
- Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM)
- Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
- CanaKit Turbine Black Case for the Raspberry Pi 5
- CanaKit Low Noise Bearing System Fan
- Mega Heat Sink - Black Anodized
const fs = require('node:fs/promises');
const path = require('node:path');
const Database = require('better-sqlite3');
const puppeteer = require('puppeteer');
const DB_PATH = process.env.DB_PATH || 'pages.sqlite';
const OUTPUT_DIR = process.env.OUTPUT_DIR || 'screenshots';
const CONCURRENCY = Number(process.env.CONCURRENCY || 3);
const NAVIGATION_TIMEOUT_MS = Number(process.env.NAVIGATION_TIMEOUT_MS || 30000);
if (!Number.isInteger(CONCURRENCY) || CONCURRENCY < 1) {
throw new Error('CONCURRENCY must be a positive integer');
}
function validateUrl(value) {
if (typeof value !== 'string' || value.trim() === '') {
throw new Error('URL is empty');
}
const parsed = new URL(value);
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
throw new Error(`Unsupported URL protocol: ${parsed.protocol}`);
}
return parsed.href;
}
async function main() {
await fs.mkdir(OUTPUT_DIR, { recursive: true });
const db = new Database(DB_PATH, { readonly: true });
let rows;
try {
rows = db.prepare('SELECT id, url FROM pages ORDER BY id').all();
} finally {
db.close();
}
const browser = await puppeteer.launch({ headless: true });
const results = new Array(rows.length);
let nextIndex = 0;
async function worker() {
while (true) {
const index = nextIndex++;
if (index >= rows.length) return;
const row = rows[index];
let page;
const filename = `${String(row.id)}.png`;
const outputPath = path.join(OUTPUT_DIR, filename);
try {
const url = validateUrl(row.url);
page = await browser.newPage();
page.setDefaultNavigationTimeout(NAVIGATION_TIMEOUT_MS);
await page.goto(url, { waitUntil: 'domcontentloaded' });
await page.screenshot({ path: outputPath, type: 'png', fullPage: true });
results[index] = { id: row.id, ok: true, file: outputPath };
} catch (error) {
results[index] = { id: row.id, ok: false, error: error.message };
} finally {
if (page) await page.close().catch(() => {});
}
}
}
try {
await Promise.all(
Array.from({ length: Math.min(CONCURRENCY, rows.length) }, () => worker())
);
} finally {
await browser.close();
}
for (const result of results) {
if (result.ok) {
console.log(`OK id=${result.id} file=${result.file}`);
} else {
console.error(`FAIL id=${result.id} error=${result.error}`);
}
}
const failures = results.filter((result) => !result.ok).length;
console.log(`Finished ${results.length} rows; ${failures} failed.`);
if (failures > 0) process.exitCode = 1;
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Run it from the directory containing pages.sqlite:
node capture.js
Optional environment variables let you change the database path, output directory, worker count, and navigation timeout without editing the script:
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 reinstallDB_PATH=./data/pages.sqlite OUTPUT_DIR=./shots CONCURRENCY=2 NAVIGATION_TIMEOUT_MS=45000 node capture.js
Choose readiness and screenshot behavior
The sample uses waitUntil: 'domcontentloaded' to proceed when the initial document has been parsed. That does not guarantee that every image, font, client-rendered component, or lazy-loaded section is ready. Select readiness based on the pages being captured rather than assuming one navigation event fits every site.
Rank #3
- CanaKit Raspberry Pi 5 Essentials Starter Kit
domcontentloaded: useful when the initial document is enough and waiting for all network activity would stall or delay the batch.load: waits for the page load event, which can suit conventional pages but still does not ensure later dynamic content is finished.networkidlevariants: can help with pages that settle after requests finish, but analytics, polling, and persistent connections may prevent a page from becoming idle. Puppeteer navigation and timeout behavior is documented in its Page.goto reference.
In the screenshot call, fullPage: true captures beyond the current viewport. Puppeteer’s documented default is false, so specify the choice rather than relying on the default. Use type to select PNG, JPEG, or WebP where supported by the current API; PNG is the documented default. quality applies to applicable lossy formats, not PNG. clip can target a region, captureBeyondViewport controls capture outside the viewport, and omitBackground requests transparency. See the official ScreenshotOptions reference for the current option details.
Adapt the database and output handling
Use your database’s query and driver
Only the SQL selection and connection code are database-specific. Keep the returned shape equivalent to { id, url }, and use a query that selects only the intended rows. For large tables, fetch a bounded set at a time using a stable ordering or keyset pagination rather than loading every row into memory; preserve the same unique row identifier when writing the file.
Rank #4
- All-in-One Complete Kit: This SANOOV RPi 5 bundle comes with Raspberry Pi 5 4GB RAM single board, active cooler, durable ABS case and screwdriver. No extra parts needed, ready to use right out of the box for beginners and hobbyists
- Powerful Single Board Computer: Equipped with 4GB RAM and high-performance processor, delivers fast running speed for 4K playback, AI projects, programming and daily computing tasks. SANOOV for raspberry pi 5 4GB is equipped with broadcom 64 quad-core Arm Cortex A76 processor with gigabit ethernet and upgraded with IEEE 802.11ac Wi-Fi, Bluetooth 5.0 dual-band 2.4Ghz and 5Ghz and Power Over Ethernet (POE). Upgrading delivers 2-3 x speed vs Pi 4, redefining the experience
- Efficient Active Cooler: Effectively lowers operating temperature and prevents performance throttling. Runs quietly even under long-time heavy load, ensures stable operation all day long. SANOOV RPi 5 4GB kit offer an active cooler, which combines an aluminium heatsink with a high-performance PWM fan. Active cooler is fully compatible with the Pi OS, which can effectively reduce the temperature of RPi5 and ensure its good performance during long-term high load operation
- Sturdy ABS Protective Case: Well-fitted for Raspberry Pi 5 board, can be secured with 4 screws to effectively protect the Pi 5 motherboard from damage, reserves full access to all ports and buttons. SANOOV uses ABS material to produce the case, which has a softer texture and feel. Meanwhile, SANOOV case adopts a layered design for easy disassembly and installation. (Tip: The Case cannot install M.2 HAT Add on Board and Solid State Drive!)
- Wide Application & Full Compatibility: Seamlessly compatible with official OS and mainstream peripheral accessories for Raspberry Pi 5. Whether you are a beginner, student, electronics hobbyist or professional developer, this all-in-one kit meets your diverse needs. It excels in IoT projects, robotics design, retro gaming devices, home media servers and other DIY creations. Backed by a large global community, you can easily find guides, technical support and shared projects online
Keep output names stable and safe
The example uses the database ID rather than a URL-derived filename, so duplicate URLs do not overwrite each other and URL characters cannot become path components. If IDs are not unique across tables or capture runs, include a sanitized namespace or run identifier in the filename. Decide whether a rerun should overwrite prior images or write into a new run directory.
Choose files or in-memory results
page.screenshot({ path }) writes to a path. Without a path, Puppeteer returns image data that the application can upload or store in another backend. For very large batches, consider how image buffers and database rows are streamed or persisted so memory use does not grow without bound.
Best Value
- 【What you Get】You will get 1*Pi 5 8GB Single Board,1*RasTech Case,1*Active Cooler,1*Screwdriver,1*Installation instructions,12-month free warranty, lifetime service, 24-hour prompt and friendly response.
- 【More Connectors】There are two USB 3.0 ports(5Gbps simultaneously) and two USB 2.0 ports, which triple total bandwidth ,support any combination of up to two cameras or displays. Peak SD card performance is doubled through support for the SDR104 high-speed mode. It provides a smooth desktop experience for you. Offer Gigabit Ethernet and a PCIe interface, along with dual-band Wi-Fi and Bluetooth 5.0/BLE wireless capability. The RasTech Pi 5 Kit use the new 27W 5.1V 5A USB-C power connector.
- 【 Support Dual 4Kp60 Display 】Each of the two microHDMI sockets can control a 4K display at 60 Hertz, now support HDR, offering super HD video for media streaming projects. RPi 5 is the first RPi model that comes with a PCI Express port (PCIe 2.0 x1 with 500 MB/s) to attach SSDs (requires separate M.2 HAT).
- 【 Excellent Chips And Applications】Pi 5 is a full-size Pi computer using silicon built in-house at Pi. The RP1 “southbridge” provides the bulk of the I/O capabilities for Pi 5. Pi 5 is more friendly and convenient in the development of Internet of Things, Web development, machine identification, automatic control and other electronic equipment applications and network.
- 【 Faster CPU, Better GPU 】 Pi 5 features a Broadcom BCM2712 64-bit quad-core Arm Cortex-A76 processor running at 2.4GHz, it delivers a 2–3× increase in CPU performance relative to RaspberryPi 4. The 800MHz VideoCore VII GPU is compatible to OpenGL ES 3.1 and Vulkan 1.2, substantial uplift in graphics performance. Pi 5 Offers lightning-fast CPU speed, a PCI Express interface, a Real Time Clock (RTC) and a power button and runs significantly cooler than Pi 4.
Concurrency, retries, and reliability
A single Puppeteer Browser can have multiple Page instances, so a batch can use parallel page jobs while reusing the browser. More workers may reduce elapsed time, but also increase CPU and memory use and load on target sites. There is no documented universally safe worker count; start conservatively, monitor browser stability and target responses, then adjust for the deployment.
- Each page is closed in a
finallyblock, including after navigation or capture errors. - Each row produces a success or failure record, and a failure sets a nonzero process exit code after the remaining rows finish.
- Retries are intentionally omitted. Add them only with a defined limit and policy, and distinguish transient navigation failures from invalid input or permanent access errors.
- For resumable jobs, persist per-row status and output location outside the process; a console log alone is not durable job tracking.
- Use only URLs your application is permitted to fetch. URL parsing and protocol checks do not by themselves prevent access to internal services or other server-side request risks; enforce your application’s network and hostname policy.
Troubleshooting common failures
- Browser executable missing: with
puppeteer, verify installation completed and its browser download was not blocked. Withpuppeteer-core, configure the browser executable or connection supplied by your environment. - Invalid URL or unsupported protocol: inspect the database value and normalize it according to your application’s rules; the sample accepts only absolute HTTP and HTTPS URLs.
- Navigation timeout: the site may be slow, blocked, or continuously active. Adjust the timeout deliberately, consider a different readiness condition, or mark the row for investigation rather than retrying indefinitely.
- Screenshot is incomplete:
domcontentloadedmay occur before client-rendered content or lazy images appear. Add a targeted selector wait or other site-specific readiness condition before capture. - Blank, blocked, or challenge page: the target may require authentication, reject automation, or present a bot check. Respect access controls and site terms; do not treat a completed navigation as proof the intended content loaded.
- Files overwrite one another: ensure the output key is unique for every row and run. Do not base it on an unsanitized URL.
- Machine runs out of resources: lower the bounded worker count, reduce full-page captures where unnecessary, or split the batch into smaller chunks.
Or skip the browser setup
For a hosted one-request capture, ScreenshotNeo returns a screenshot or PDF from a URL. It removes cookie and consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. The API accepts other screenshot APIs’ parameter names too, which can make switching easier. See the API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Use the URL from each database row in place of https://stripe.com, and store the response under the corresponding stable row ID. Sign up for 1,000 free screenshots a month with no card.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
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.




