Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsOn macOS, the most direct way to capture a website screenshot with Node.js is Puppeteer: install it, launch its managed Chrome browser, navigate to a URL, and call page.screenshot(). The example below saves the visible viewport as a PNG and closes the browser even if navigation or capture fails.
Capture a website screenshot with Puppeteer
In a Terminal window, create a project, install Puppeteer, and save the following as screenshot.js. The full puppeteer package normally downloads a compatible Chrome for Testing build and chrome-headless-shell during installation.
As an Amazon Associate I earn from qualifying purchases.
npm init -y
npm install puppeteer
This script uses ES module syntax. Add "type": "module" to your project’s package.json if Node.js is treating .js files as CommonJS; alternatively, save the file as screenshot.mjs.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle2' });
await page.screenshot({ path: 'screenshot.png' });
console.log('Saved screenshot.png');
} finally {
await browser.close();
}
Run it from the project directory with node screenshot.js. Puppeteer’s screenshot guide documents Page.screenshot(); the try/finally wrapper here ensures the browser is closed after success or failure. The file is written relative to the directory from which you run Node.
#1 Best Overall
- AN AMAZING MAC AT A SURPRISING PRICE — With an incredibly portable and durable aluminum design, up to 16 hours of battery life,* and the A18 Pro chip, MacBook Neo is ready to go wherever school takes you.
- FOUR STUNNING COLORS. ONE DURABLE DESIGN — Choose from four beautiful colors — Silver, Blush, Citrus, or Indigo — each with a color-coordinated keyboard. And MacBook Neo is made with a durable recycled aluminum enclosure that helps it reach 60 percent recycled content by weight — the most ever in any Apple product.*
- FLY THROUGH EVERYDAY ASSIGNMENTS — Whether you’re cramming for finals, using Apple Intelligence* to summarize class notes, creating presentations, or even playing the latest Apple Arcade game,* MacBook Neo delivers the performance and AI capabilities you need to get things done.
- UP TO 16 HOURS OF BATTERY LIFE — MacBook Neo delivers all day battery life, so you can power through from early morning classes to late night study sessions without worrying about plugging in.
- A VIBRANT 13-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Neo supports 1 billion colors, so photos and videos pop and text is crisp for easy reading.
Choose what to capture
Visible browser viewport
The example captures the page viewport. Set its dimensions before navigation if you need a particular desktop or mobile-sized layout:
await page.setViewport({ width: 1280, height: 800 });
Place this after newPage() and before goto(). Puppeteer’s Page API documents screenshot capture and page configuration in its Page API reference.
Full scrollable page
For a tall page rather than just the visible viewport, pass the full-page option:
Recommended Free Tools
await page.screenshot({ path: 'full-page.png', fullPage: true });
Full-page capture represents the scrollable page as a tall image. Very long pages may produce large image files, and pages that load content only as you scroll may require additional scrolling or site-specific waits before capture. See Puppeteer’s Screenshots guide for supported screenshot options.
Rank #2
- BUILT FOR COLLEGE. AND BEYOND — MacBook Air with the M5 chip packs blazing speed and powerful AI capabilities into an incredibly portable design. And with up to 18 hours of battery life,* this thin and light powerhouse is ready to take on almost any major, just about anywhere.
- TEAR THROUGH TOUGH ASSIGNMENTS — With its faster CPU and unified memory, the M5 chip delivers even more performance and fluidity across apps, making multitasking and creative workflows smooth and responsive. A powerful Neural Engine and next-generation GPU with Neural Accelerators give you a powerful platform for AI.
- MAKE QUICK WORK OF YOUR TO-DO LIST — Apple Intelligence helps you write, express yourself, and get things done effortlessly — whether it’s for school or everyday life. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
- UP TO 18 HOURS OF BATTERY LIFE — MacBook Air delivers incredible battery life with amazing performance, so you can power through a full day of classes without worrying about plugging in.
- A BRILLIANT 13.6-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Air supports 1 billion colors, making photos and videos pop with rich contrast and sharp detail, and text appears supercrisp. So everything — from class presentations to movies to games — looks truly stunning.
One element
To capture a particular element, locate it and use the element handle’s screenshot method. This example waits for a CSS selector to appear:
const element = await page.waitForSelector('.product-card');
if (!element) throw new Error('Product card was not found');
await element.screenshot({ path: 'product-card.png' });
Replace .product-card with a selector on the target page. Puppeteer attempts to scroll a hidden element into view before capturing it. A selector that never appears causes the wait to time out; verify the selector and, if necessary, set an appropriate timeout in the wait options.
Image bytes instead of a file
If another part of your Node program needs the image data, capture without a path and retain the returned bytes:
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 →const imageBytes = await page.screenshot({ type: 'png' });
You can pass those bytes to an image-processing library or write them to a file with Node’s filesystem API. Puppeteer’s supported output options are documented in its Screenshots guide.
Rank #3
- AN AMAZING MAC AT A SURPRISING PRICE — With an incredibly portable and durable aluminum design, up to 16 hours of battery life,* and the A18 Pro chip, MacBook Neo is ready to go wherever school takes you.
- FOUR STUNNING COLORS. ONE DURABLE DESIGN — Choose from four beautiful colors — Silver, Blush, Citrus, or Indigo — each with a color-coordinated keyboard. And MacBook Neo is made with a durable recycled aluminum enclosure that helps it reach 60 percent recycled content by weight — the most ever in any Apple product.*
- FLY THROUGH EVERYDAY ASSIGNMENTS — Whether you’re cramming for finals, using Apple Intelligence* to summarize class notes, creating presentations, or even playing the latest Apple Arcade game,* MacBook Neo delivers the performance and AI capabilities you need to get things done.
- UP TO 16 HOURS OF BATTERY LIFE — MacBook Neo delivers all day battery life, so you can power through from early morning classes to late night study sessions without worrying about plugging in.
- A VIBRANT 13-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Neo supports 1 billion colors, so photos and videos pop and text is crisp for easy reading.
Wait for the page you actually need
waitUntil: 'networkidle2' waits for network activity to quiet according to Puppeteer’s navigation condition, but it is not proof that every visual element is ready. Analytics, polling, delayed widgets, lazy images, and client-side rendering can make readiness site-specific.
If a particular element signals that the useful content has loaded, wait for it explicitly after navigation:
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
await page.waitForSelector('main article');
await page.screenshot({ path: 'article.png' });
Choose a selector that reflects the content you need. For pages that render fonts or images asynchronously, wait for the relevant content or resource before capture rather than assuming navigation completion guarantees a settled image.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Installing and configuring the browser on macOS
Puppeteer’s full package manages browser downloads in its cache by default. Its installation guide, version 25.12.0, gives an approximate macOS Chrome download size of 170 MB; this is version-sensitive and is not the total disk use for every project. See the current Puppeteer installation guide for installation behavior and configuration.
Rank #4
- AN AMAZING MAC AT A SURPRISING PRICE — With an incredibly portable and durable aluminum design, up to 16 hours of battery life,* and the A18 Pro chip, MacBook Neo is ready to go wherever school takes you.
- FOUR STUNNING COLORS. ONE DURABLE DESIGN — Choose from four beautiful colors — Silver, Blush, Citrus, or Indigo — each with a color-coordinated keyboard. And MacBook Neo is made with a durable recycled aluminum enclosure that helps it reach 60 percent recycled content by weight — the most ever in any Apple product.*
- FLY THROUGH EVERYDAY ASSIGNMENTS — Whether you’re cramming for finals, using Apple Intelligence* to summarize class notes, creating presentations, or even playing the latest Apple Arcade game,* MacBook Neo delivers the performance and AI capabilities you need to get things done.
- UP TO 16 HOURS OF BATTERY LIFE — MacBook Neo delivers all day battery life, so you can power through from early morning classes to late night study sessions without worrying about plugging in.
- A VIBRANT 13-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Neo supports 1 billion colors, so photos and videos pop and text is crisp for easy reading.
If Chrome was not downloaded
Some package managers and organizational policies block dependency install scripts. In that case, Puppeteer may install while skipping the browser download, and running the script can fail with a “Could not find Chrome” error. From the project directory, install Puppeteer’s browser explicitly:
npx puppeteer browsers install
When to use puppeteer-core
puppeteer-core does not download Chrome. Use it when you manage the browser yourself or connect to a remote browser, and configure the executable path or browser channel for the environment you are using. For a first local macOS setup, the standard puppeteer package avoids that extra browser-management step.
Is Playwright a better fit?
Playwright also provides a documented Node.js screenshot workflow. Its Page API shows capturing with WebKit and supports Chromium and Firefox as well. Choose based on the browser automation API and browser behavior your project needs, or whether the screenshots belong in a Playwright Test visual-comparison workflow; the available documentation does not establish that one library is universally faster or better on every Mac.
Playwright documents full-page capture and returning screenshots as a buffer in its Screenshots guide. Its Page API reference describes the page methods. For visual baselines, keep the capture environment consistent: Playwright notes that rendering can vary with host operating system, browser version, settings, hardware, power source, and headless mode.
Best Value
- FAST RUNS IN THE FAMILY — The 16-inch MacBook Pro with the M5 Pro or M5 Max chip brings next-generation speed and powerful on-device AI to personal, professional, and creative tasks. With all-day battery life, double the starting storage,* and a breathtaking Liquid Retina XDR display, it’s pro in every way.*
- BUCKLE UP — Along with a next-generation CPU, faster unified memory, and up to 2x faster SSD storage,* M5 Pro and M5 Max feature a more powerful GPU with a Neural Accelerator built into each core, delivering faster AI performance and on-device training capabilities. So you can blaze through demanding workloads at mind-bending speeds.
- BUILT FOR AI — Apple silicon, and every major component that powers it, is designed to run demanding on-device AI workloads like LLM inference and training. And Apple Intelligence helps you write, express yourself, and get things done effortlessly with groundbreaking privacy protections at every step.*
- ALL-DAY BATTERY LIFE — MacBook Pro delivers the same exceptional performance whether it’s running on battery or plugged in.*
- MACOS RUNS APPS FAST — All your go-to apps run lightning fast in macOS, including built-in apps like FaceTime and Messages. Plus, built-in virus protection and free software updates help keep your Mac running smoothly and securely.
Common problems and fixes
- “Could not find Chrome.” The install script may have been blocked and browser binaries were not downloaded. Run
npx puppeteer browsers installin the project. importis rejected or reported as unexpected syntax. Node is interpreting the file as CommonJS. Add"type": "module"topackage.jsonor use an.mjsfilename.- The screenshot is blank or missing page content. Navigation may have completed before the target content rendered. Wait for a relevant selector or resource, and confirm the target page is accessible in the browser environment.
- The element screenshot times out. Check that the CSS selector matches the current page and is not inside content that requires another interaction or wait.
- The image is cut off at the viewport. Use
fullPage: truefor a full scrollable capture, or capture a specific element. - Visual-diff images change across machines. Keep operating system, browser version, settings, hardware, and headless mode consistent where possible. Review differences rather than treating every pixel change as an application defect.
Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server. One GET request can return an image or PDF; this cURL example saves a WebP screenshot. 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
ScreenshotNeo accepts cookie or consent banners before capture 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 response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and other MCP clients. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan to try it with no card.
Frequently Asked Questions
Can I save a screenshot as JPEG or WebP with Puppeteer?
Puppeteer supports screenshot output types including PNG, JPEG, and WebP where supported by its API and browser. Check the installed version’s screenshot guide for the relevant options.
Does Puppeteer require Google Chrome to be installed separately on a Mac?
The full puppeteer package normally downloads a compatible Chrome for Testing build and chrome-headless-shell. puppeteer-core does not download a browser, so you must provide or manage one.
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.




