Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A blank Puppeteer screenshot usually means Chrome captured the page before its content rendered, navigated to an unexpected or error document, or was prevented from loading the resources the app needs. Start by setting a known viewport, checking the navigation response and final URL, and waiting for a visible app-specific selector—not just for page.goto() to finish—before taking the screenshot.

Why Puppeteer can save a valid but blank screenshot

page.screenshot() captures the page as it is at that moment. The output can be a perfectly valid image even if the page is only an empty application shell because client-side JavaScript has not yet drawn the interface. A successful navigation promise is not proof that meaningful content appeared: the destination may be an error page, an unexpected document, or a page whose required scripts never ran.

Diagnose in this order: confirm the destination and HTTP response, establish a known viewport, wait for a condition that proves the app is ready, and then inspect interception and runtime errors if the content is still missing. That separates rendering failures from image-file or encoding problems.

Wait for the application, not just the navigation

For a JavaScript-rendered app, navigation completion and application readiness are separate events. A network-idle condition can help, but it is not a guarantee: a site may continue loading lazy content after the network quiets, or keep requests open. Pair a navigation wait with a selector or predicate that means the particular content you need is visible. Chrome for Developers demonstrates combining networkidle0 with a selector wait, and notes that lazy-loading pages may need more time or a site-specific condition (Chrome for Developers).

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • 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.
await page.goto(url, { waitUntil: 'networkidle2' });
await page.waitForSelector('#app main', { visible: true });
await page.screenshot({ path: 'page.png', fullPage: true });

Choose a selector that represents finished content, such as a report title or results list—not merely the root #app element, which may exist before rendering. Puppeteer’s waitForSelector defaults to a 30-second timeout; set a different timeout when the application’s normal render time requires it. For a canvas-based interface, wait for a meaningful predicate such as a nonzero canvas width and height, and, if available, for the application’s loading state to clear.

Fixed sleeps such as waitForTimeout(5000) are weaker: they may waste time on fast runs and still be too short on slower ones. Use a delay only when the page has a known time-based behavior that cannot be observed through a selector or other readiness condition.

Check where navigation actually landed

Log the resolved URL and response status immediately after page.goto(). Navigation to about:blank or to the same URL with only a hash change can resolve with a null response. In headless shell mode, a valid HTTP response such as 404 or 500 does not itself make page.goto() throw; inspect the response status explicitly (Puppeteer Page.goto API).

const response = await page.goto(url, { waitUntil: 'domcontentloaded' });
console.log({ url: page.url(), status: response?.status() });
console.log('title:', (await page.title()).slice(0, 120));

A 404, 500, redirect to a sign-in page, blocked interstitial, or unexpected URL points to a navigation, access, or server issue—not a screenshot encoder defect. If the final URL is correct but the page body is empty, continue with the rendering and runtime checks below.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 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.

Set and verify the viewport before navigation

Puppeteer documents an 800 × 600 default viewport for connected pages. During diagnosis, set explicit desktop dimensions and verify what the page actually sees. Viewport settings control width, height, device scale factor, mobile emulation, and touch; zero width or height resets that dimension to a system default. Changing mobile or touch properties can reload the page, so set them before navigation (Puppeteer Page.setViewport API; Puppeteer Viewport API).

await page.setViewport({
  width: 1280,
  height: 800,
  deviceScaleFactor: 1,
  isMobile: false,
  hasTouch: false
});

await page.goto(url, { waitUntil: 'networkidle2' });
console.log(await page.evaluate(() => ({
  innerWidth,
  innerHeight,
  dpr: devicePixelRatio,
  body: [document.body.scrollWidth, document.body.scrollHeight]
})));

If a capture is blank only in mobile emulation, first reproduce it using this desktop baseline. A historical Puppeteer issue reports blank captures with isMobile: true in headless mode, even after changing wait conditions; treat that as a reason to test the metrics, not proof that every mobile screenshot failure has the same cause (Puppeteer issue 2374). Once desktop works, add the intended mobile width, height, device scale factor, and touch settings one at a time.

Disable request interception while debugging

When request interception is enabled, each intercepted request stalls until your handler calls continue(), respond(), or abort(). If a handler forgets to resolve requests, navigation and rendering can stall. If it aborts scripts, XHR, or fetch, the browser may load the HTML shell but never construct the visible interface. Disable interception first; restore it only after the page works without it.

If interception is required, log what you block and preserve the resources the app needs. This example allows documents, scripts, XHR, and fetch, while aborting other resource types; use such filtering only after confirming the target page can render with it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • 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.
await page.setRequestInterception(true);
page.on('request', req => {
  const allowed = new Set(['document', 'script', 'xhr', 'fetch']);
  if (allowed.has(req.resourceType())) return req.continue();
  return req.abort();
});

For first-pass diagnosis, removing the interception handler is safer than guessing an allowlist. Chrome’s headless-rendering guidance also describes request interception and how altering loaded resources changes what Chrome can render (Chrome for Developers).

Confirm the target is visible and stable

A node can exist in the DOM while remaining unusable as a screenshot target: it may have display: none, visibility: hidden, a zero-size box, or be covered by a loading overlay or modal. Animations can also move or resize a target during capture. Use a visible selector wait for page captures, and inspect the target’s geometry and computed styles if the screenshot remains empty.

const details = await page.$eval('#report', el => {
  const rect = el.getBoundingClientRect();
  const style = getComputedStyle(el);
  return {
    rect: { x: rect.x, y: rect.y, width: rect.width, height: rect.height },
    display: style.display,
    visibility: style.visibility,
    opacity: style.opacity
  };
});
console.log(details);

For an element capture, Puppeteer’s locator API waits for the element to be in the viewport and to have a stable bounding box. For example:

const target = page.locator('#report').setTimeout(30000);
await target.wait();
await target.screenshot({ path: 'report.png' });

If images below the fold matter, scroll them into view or otherwise trigger lazy loading, then check that each relevant image has completed and has a nonzero naturalWidth. A full-page screenshot does not necessarily force every application’s lazy-loading logic to fetch off-screen content.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • 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

Capture early diagnostics and distinguish DOM failures from file failures

Attach listeners before navigation so early browser and application errors are not missed. Record the final URL, status, DOM content, visible body text, geometry, failed requests, and output byte length. These facts help locate the first broken step rather than treating every blank image as a screenshot problem.

page.on('console', msg => console.log('console:', msg.type(), msg.text()));
page.on('pageerror', err => console.error('pageerror:', err));
page.on('requestfailed', req => {
  console.error('requestfailed:', req.url(), req.failure());
});

const response = await page.goto(url, { waitUntil: 'domcontentloaded' });
console.log('landed:', page.url(), 'status:', response?.status());
console.log('title:', await page.title());
console.log('body text:', (await page.evaluate(() => document.body?.innerText || '')).slice(0, 500));
console.log('DOM characters:', (await page.content()).length);

const bytes = await page.screenshot({ path: 'page.png' });
console.log('screenshot bytes:', bytes.length);

If the expected markup or body text is absent, investigate navigation, JavaScript errors, content security policy, authentication, or request interception first. If the DOM is correct but the image file is empty or cannot be opened, check the output path and how you handle the return value. Puppeteer’s Page.screenshot() returns a Uint8Array by default, or a base64 string when encoding: 'base64' is requested (Puppeteer Page.screenshot API).

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Minimal reproducible capture

This ES module example uses a desktop viewport, captures diagnostics before navigation, checks the HTTP result, waits for an app-specific visible marker, and writes a PNG. Install Puppeteer in your project and replace the example URL and selector with the page you are debugging.

import puppeteer from 'puppeteer';

const url = 'https://example.com/app';
const browser = await puppeteer.launch();

try {
  const page = await browser.newPage();
  await page.setViewport({
    width: 1280,
    height: 800,
    deviceScaleFactor: 1,
    isMobile: false,
    hasTouch: false
  });

  page.on('console', msg => console.log('console:', msg.type(), msg.text()));
  page.on('pageerror', err => console.error('pageerror:', err));
  page.on('requestfailed', req => {
    console.error('failed:', req.url(), req.failure());
  });

  const response = await page.goto(url, { waitUntil: 'networkidle2' });
  console.log('landed:', page.url(), 'status:', response?.status());

  if (response && response.status() >= 400) {
    throw new Error(`Unexpected HTTP status: ${response.status()}`);
  }

  await page.waitForSelector('#app main', { visible: true, timeout: 30000 });
  const bytes = await page.screenshot({ path: 'app.png', fullPage: true });
  console.log('wrote app.png; screenshot bytes:', bytes.length);
} finally {
  await browser.close();
}

The key ordering is viewport, navigation, readiness proof, then capture. Puppeteer’s screenshots guide likewise shows waiting for navigation before a page screenshot and waiting for an element before capturing that element (Puppeteer Screenshots guide).

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 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.

Common blank-screenshot symptoms and fixes

Symptom Likely cause What to check or change
Valid white image; app content missing Capture happened before client-side rendering, or app scripts/data did not load. Wait for a visible content selector or app-specific predicate; inspect console errors and failed script or data requests.
page.goto() resolved but no useful page appeared Unexpected destination, about:blank, redirect, or an HTTP error response. Log page.url(), title, and response?.status(); verify authentication and the final destination.
Only mobile capture is blank Mobile or touch metrics, a reload after metrics changed, or a headless-mode issue. Set and verify desktop metrics first, then add mobile settings before navigation.
Page works with interception off, fails with it on A request was left unresolved or a required script/data request was blocked. Continue, fulfill, or abort every intercepted request deliberately; preserve required document, script, XHR, and fetch requests.
Expected node is in DOM, but capture shows nothing Hidden, covered, zero-size, or unstable target. Check visibility, computed styles, bounding box, overlays, and animations; use a visible, stable element locator.
DOM appears correct, image file is empty or unreadable Output path or screenshot return-value handling. Check byte length and file-writing logic; account for the default Uint8Array or requested base64 encoding.

Performance and reliability trade-offs

Waiting for networkidle0 can provide stronger evidence that requests have quieted than waiting only for DOM content, but pages with persistent connections or ongoing activity may not reach that condition promptly. networkidle2 is a less strict network condition; neither proves the target content is visible. A selector or app predicate is the useful readiness test, while a navigation wait establishes that the document transition has progressed.

For repeatable captures, keep viewport and device settings fixed, use the same readiness condition, and record status, errors, and output size for each run. Avoid indiscriminate resource blocking as a speed shortcut: a small reduction in loaded assets is not helpful if it prevents the application from rendering. Full-page capture can also expose lazy-loading behavior that a viewport-only capture does not trigger, so explicitly validate off-screen content when it matters.

Or skip the browser setup

If your task is to obtain a screenshot rather than debug Puppeteer itself, ScreenshotNeo provides a website screenshot API and MCP server. One GET request takes a URL and returns an image or PDF; the API uses screenshot options and compatible parameter names used by other screenshot APIs. See the ScreenshotNeo API documentation for available formats and 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 and consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently asked questions

Does a blank image always mean page.screenshot() failed?

No. The screenshot can be a valid image of a page that was still blank or incomplete when captured. Check the DOM and output bytes separately to distinguish page rendering from file generation.

What does a null response from page.goto() mean?

Some navigations, including about:blank and same-URL hash changes, may resolve without a response object. Check the final URL and page contents rather than assuming the target loaded.

Should I use networkidle0 or networkidle2?

Use the network condition that suits the page, then wait for a selector or predicate that proves the content you need is ready. Network quiet alone is not a universal rendering guarantee.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.