Puppeteer can configure where a browser saves downloads and whether downloads are allowed, but it does not currently provide a built-in programmatic download-completion or file-management API. You can set a download policy and destination, then use Node.js code to wait for, validate, name, and clean up the resulting file. Keep that browser setup separate from Puppeteer’s documented file-upload support.
What Puppeteer does—and does not—manage
The Puppeteer 25.12.0 Files guide states: “Currently, Puppeteer does not offer a way to handle file downloads in a programmatic way.” In practical terms, download configuration tells the browser whether to permit downloads and where to save them. It does not give your script a built-in Puppeteer download-completed event, returned file object, integrity check, rename operation, or cleanup routine.
As an Amazon Associate I earn from qualifying purchases.
Those lifecycle tasks belong to your application: trigger the download, monitor the destination directory, decide when to stop waiting, inspect the file, and remove it when appropriate. The exact waiting and validation strategy is not prescribed by Puppeteer’s Files guide, so treat the Node.js example below as an application-side pattern and test it against your installed Puppeteer and browser versions.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Downloads are not uploads
Puppeteer’s Files guide demonstrates uploading a local file by waiting for an input[type=file] element and calling uploadFile(['./path-to-local-file']). That API sends a file from your machine to a page. It does not configure or monitor a browser download from a page to your machine.
#1 Best Overall
- 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
Choose a browser and package setup
Use puppeteer when you want the package to download and manage its compatible browser installation. Use puppeteer-core when you provide the browser yourself or connect to a remote browser. Your download configuration must target the browser context actually used by the page.
| Setup | Browser ownership | When it fits |
|---|---|---|
puppeteer |
Installing the package downloads Chrome for Testing and chrome-headless-shell. |
You want the standard locally managed Puppeteer browser setup. |
puppeteer-core |
Does not download Chrome; the developer manages the browser or connects remotely. | You already have a browser deployment or use a remote DevTools-compatible browser. |
The Puppeteer 25.12.0 Installation guide gives approximate browser download sizes of 170 MB on macOS, 282 MB on Linux, and 280 MB on Windows. These are platform-specific approximate figures from that guide, not permanent size guarantees.
Configure a download destination and policy
The DownloadBehavior API reference defines a policy and a downloadPath. The path is required with either allow or allowAndName. The available policies are allow, allowAndName, deny, and default; default behavior is left to the browser.
Windows 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 reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteRank #2
- 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.
allow: permit downloads and save them to the configured path using browser/server-provided names.allowAndName: permit downloads but name files according to their download GUIDs. Do not expect the original filename in this mode.deny: deny downloads.default: use the browser’s default download behavior.
ConnectOptions exposes downloadBehavior as a context-level setting. The BrowserContextOptions Next reference also lists it and says that unset behavior defaults to the browser default; that page is explicitly a Next reference, not a stable-release guarantee. Match the code to your installed Puppeteer version and browser protocol.
Example: set behavior when connecting
This example illustrates the documented ConnectOptions setting when connecting to a browser endpoint. It uses allow so the saved filename is not replaced with a GUID. Supply a valid endpoint and an absolute writable directory for your environment.
import puppeteer from 'puppeteer-core';
import path from 'node:path';
const downloadPath = path.resolve('./downloads');
const browser = await puppeteer.connect({
browserWSEndpoint: process.env.PUPPETEER_WS_ENDPOINT,
downloadBehavior: {
policy: 'allow',
downloadPath,
},
});
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
await page.click('a[data-download]');
// Download completion and file handling are application-managed.
} finally {
await browser.disconnect();
}
This shows browser policy configuration, not a completion API. The page selector and URL are illustrative and must match the site being automated. Create the destination directory before connecting if your environment requires it, and ensure the browser process—not only the Node.js process—can write there. For a locally launched browser, configure the relevant context using the API supported by the Puppeteer version you have installed; do not assume a connection option is interchangeable with an older page-level snippet.
Rank #3
- 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.
Wait for and manage the downloaded file in Node.js
Since Puppeteer does not report download completion through a built-in file-download handler, your application needs a bounded strategy. The following runnable pattern uses Node.js filesystem checks to wait until a file appears and its size remains unchanged across multiple checks. It ignores common in-progress temporary suffixes, enforces a timeout, and rejects empty output. These are application-level safeguards, not Puppeteer guarantees; adapt temporary-file rules to the browser and download server in use.
Free tools Windows power users keep installed
One-click scans. No signup required.
import { readdir, stat, mkdir } from 'node:fs/promises';
import path from 'node:path';
import puppeteer from 'puppeteer';
const downloadPath = path.resolve('./downloads');
await mkdir(downloadPath, { recursive: true });
async function waitForCompletedFile(directory, {
timeoutMs = 60_000,
intervalMs = 500,
stableChecks = 3,
} = {}) {
const deadline = Date.now() + timeoutMs;
const sizes = new Map();
const temporarySuffixes = ['.crdownload', '.part', '.tmp'];
while (Date.now() < deadline) {
for (const name of await readdir(directory)) {
if (temporarySuffixes.some(suffix => name.endsWith(suffix))) continue;
const fullPath = path.join(directory, name);
let info;
try {
info = await stat(fullPath);
} catch {
continue; // File may have disappeared between listing and stat.
}
if (!info.isFile() || info.size === 0) continue;
const previous = sizes.get(name);
const stable = previous && previous.size === info.size
? previous.count + 1
: 1;
sizes.set(name, { size: info.size, count: stable });
if (stable >= stableChecks) return fullPath;
}
await new Promise(resolve => setTimeout(resolve, intervalMs));
}
throw new Error(`No completed non-empty download appeared within ${timeoutMs} ms`);
}
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
await page.click('a[data-download]');
const filePath = await waitForCompletedFile(downloadPath);
const fileInfo = await stat(filePath);
console.log({ filePath, bytes: fileInfo.size });
// Validate expected type/content here before using the file.
} finally {
await browser.close();
}
The launch snippet does not show a version-independent context configuration call: set downloadBehavior using the API surface documented for your installed release and browser setup. The API references linked above should be checked alongside the exact package version in your lockfile.
Make file handling safe
- Use a dedicated directory per run or job so concurrent downloads do not get mistaken for one another.
- Use an explicit timeout and fail clearly if the expected file does not arrive.
- Check that the file is non-empty and validate its expected format or contents before processing it. A stable size alone does not prove a valid or complete document.
- For workflows that require a specific output name, prefer
allowand validate the resulting name, or perform an application-side rename after confirming completion. WithallowAndName, map GUID-named files to jobs using your own job bookkeeping. - Remove temporary or completed files only after downstream work succeeds or fails according to your retention policy; ensure cleanup code does not delete another concurrent job’s files.
Install the browser if Puppeteer cannot find it
With puppeteer, browser installation normally runs as part of package installation. If package-manager settings block install scripts, the browser download can be skipped and launch may fail with a missing Chrome error. The Puppeteer 25.12.0 Installation guide documents this manual installation command:
Rank #4
- 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.
npx puppeteer browsers install
Check your package manager’s install-script policy if the browser is still missing. The guide also describes opting back in to the package’s postinstall script. With puppeteer-core, no Chrome download is performed automatically, so install or provide the browser separately, or connect to a remote browser.
Troubleshoot common download problems
| Symptom | Likely cause | What to check |
|---|---|---|
| Launch fails because Chrome is missing | Package install scripts were blocked, or puppeteer-core is being used without a managed browser. |
For the standard package, run npx puppeteer browsers install and review install-script settings. For core, provide a browser or remote endpoint. |
| No file appears in the target directory | Download policy is not allowing the operation, the configured path is wrong, or the browser process cannot write there. | Use a writable absolute path; ensure downloadPath is provided with allow or allowAndName; confirm the page action actually starts a download. |
| Code waits forever | The application has no timeout, the download never began, or its completion indicator differs from the implementation’s assumptions. | Bound the wait, log directory contents, inspect the page action and browser behavior, and adapt temporary-file detection to the browser in use. |
| Saved filename is unexpected | allowAndName intentionally uses download GUIDs, or the server supplied a different name than expected. |
Use allow when the server-provided name is needed, or maintain an application mapping and rename only after validating completion. |
| Older snippet has no effect or fails | It may use a page-level API that does not match the current context-level API or protocol. | Check the documentation for the exact installed Puppeteer release and the connected browser protocol rather than mixing old snippets with current options. |
| File exists but is corrupt or incomplete | Existence or stable size was treated as proof of correctness. | Validate expected file type and contents, and use a server-specific success signal where available; filesystem stability is only a practical heuristic. |
Performance, reliability, and cost considerations
Use a per-job destination to avoid expensive directory scans and ambiguous matches when several pages download concurrently. Set a timeout based on the expected file sizes and network conditions rather than waiting indefinitely. For large files, avoid reading the entire file into memory just to confirm it exists; inspect metadata first and validate content using a streaming or format-specific check suited to the file.
Reliability depends on both sides of the workflow: browser permission and writable storage, plus application logic that detects the right output and handles failures. Puppeteer’s documentation establishes the policy/path configuration but not a universal completion-detection method, so validate your chosen strategy against your specific browser, site, and concurrency model. Downloaded browser binaries also add installation time and disk use; the platform-size figures above are approximate values from Puppeteer’s version 25.12.0 guide.
Best Value
- 【Powerful Performance】Equipped with Intel N150 CPU, featuring up to 4.4 GHz, ensuring efficient and powerful multitasking capabilities.
- Designed for mobility with a slim 0.71-inch profile and lightweight, making it easy to carry between home, office
- 【Versatile Connectivity】 connected with multiple ports including USB 3.0 Type-C, and a headphone/mic combo jack, with Wi-Fi and Bluetooth for seamless wireless networking.
- One Year Microsoft 365
Or skip the browser setup
If you need a screenshot rather than a downloaded file, ScreenshotNeo returns a PNG, JPEG, WebP, or PDF through a single GET request. The example below saves a screenshot response; 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
- Cookie/consent banners, newsletter popups, and chat widgets are removed before capture.
- Bot checks, blank pages, and failed loads are not billed.
- An MCP server provides screenshot tools for AI agents, including Claude, Cursor, and other MCP clients.
- 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 get 1,000 screenshots a month with no card.
Frequently Asked Questions
Does Puppeteer have a built-in download-finished event?
No. Its Files guide says programmatic download handling is not currently offered; completion detection must be implemented by your application.
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 →Does `allowAndName` keep the downloaded filename?
No. It names files according to their download GUIDs.
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.

