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

Load the page in a real browser, wait for a condition that proves the content you need is visible, and then take the screenshot. A browser’s “load” event—or even a quiet network—does not guarantee that an app-specific update, lazy-loaded section, or animation has finished. When you control the site, wait for its ready marker; otherwise, wait for the target element or text.

Why “JavaScript finished loading” is not a single browser event

JavaScript can update a page after the document loads, and pages may continue fetching data, render content after an interaction, or load images as you scroll. Choose a readiness condition that corresponds to the visual state you want—not simply the earliest navigation milestone.

Playwright offers navigation milestones including commit, domcontentloaded, load, and networkidle. Its documentation defines networkidle as no network connections for at least 500 ms and marks it “DISCOURAGED” for testing, recommending web assertions to assess readiness instead: Playwright Page API. Network quiet is a network condition, not proof that the page looks right.

Use Playwright and wait for the content you need

This JavaScript example waits for the document’s DOM, then for a site-specific readiness element before saving a full-page PNG. Replace the sample selector with a marker that actually appears when the desired content is ready.

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.
const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  try {
    const page = await browser.newPage();
    await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });

    // Replace this with a real ready marker or target element on the page.
    await page.locator('[data-page-ready="true"]').waitFor({
      state: 'visible',
      timeout: 10000
    });

    await page.screenshot({ path: 'page.png', fullPage: true });
  } finally {
    await browser.close();
  }
})();

The separate waits are deliberate: domcontentloaded is a document lifecycle milestone; the locator wait checks the page state relevant to your capture. Playwright documents both navigation and locator-based waits, along with screenshot options: Page API and Screenshots guide.

If the site has no ready marker

Wait for the element or text that must appear in the screenshot. If readiness depends on a broader condition, Playwright’s page.waitForFunction() can wait until a page predicate becomes truthy. Make that predicate specific to the needed state and set a timeout appropriate to the workflow. A fixed pause can be too short on a slow run and unnecessarily long on a fast one.

If you only want the viewport or an image buffer

Omit fullPage: true to capture the current viewport. Playwright can also return screenshot bytes as a buffer for post-processing or pixel-diff workflows, rather than writing directly to a file; see its screenshot guide.

Other browser automation options

Puppeteer

Puppeteer’s screenshot guide demonstrates navigating with networkidle2 and then capturing the page. Treat that as a convenient example, not a universal readiness rule: if important content appears later or background requests continue, wait for the target UI condition as well.

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.
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    await page.goto('https://example.com', { waitUntil: 'networkidle2' });

    // Prefer a content-specific wait when network quiet is not enough.
    await page.waitForSelector('[data-page-ready="true"]', {
      visible: true,
      timeout: 10000
    });

    await page.screenshot({ path: 'page.png', fullPage: true });
  } finally {
    await browser.close();
  }
})();

Puppeteer also supports capturing a particular element with ElementHandle.screenshot(); its documentation says this scrolls the element into view if it is hidden. See the Puppeteer screenshots guide.

Selenium WebDriver with JavaScript

driver.get(url) waits for document loading, but use a condition wait when the required content has a separate observable state. This example checks a real ready marker and then takes a PNG screenshot; adapt the selector and error handling to your bindings.

const { By } = require('selenium-webdriver');

await driver.get('https://example.com');
await driver.wait(async () => {
  try {
    const element = await driver.findElement(By.css('[data-page-ready="true"]'));
    return await element.isDisplayed();
  } catch (error) {
    return false;
  }
}, 10000);

const pngBase64 = await driver.takeScreenshot();

Selenium documents navigation, repeated condition waits, and screenshot capture in its WebDriver documentation.

Choose the screenshot type that matches the job

What you need Capture choice Practical note
What is visible in the browser window Viewport screenshot Use the basic page screenshot call without full-page capture.
The entire scrollable document Full-page screenshot Playwright supports full-page capture; confirm the page has rendered content that normally appears only after scrolling.
One chart, widget, or content region Element screenshot Puppeteer documents element screenshots and scrolling a hidden target into view.
Image bytes for processing Screenshot buffer Playwright’s buffer output can be post-processed or passed to a pixel-diff tool.

These behaviors are described in the Playwright screenshot guide and Puppeteer screenshots guide.

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.

Or skip the browser setup

ScreenshotNeo takes a website screenshot with one GET request, so you do not need to install or manage a browser for this capture. Its API also supports waiting for a selector, delay, or network idle. See the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

Before capture, ScreenshotNeo can accept cookie or consent banners like a visitor and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month without a card.

Troubleshooting missed or incomplete captures

The screenshot misses the JavaScript-rendered content

Check whether the selector or predicate you wait for actually identifies the final state. Wait for the target text, visible element, or application ready marker before capture. If you own the site, an explicit ready marker is easier to reason about than guessing from load timing.

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.

The network-idle wait hangs or finishes too early

A page with ongoing requests may not become network-idle, while a brief quiet period may occur before the UI you need appears. Use an observable UI condition instead; Playwright specifically discourages network idle as a testing readiness strategy in its Page API.

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

A long page is cut off

Use a full-page screenshot where supported. If lower sections are rendered only after scrolling, reproduce the relevant scroll or interaction first, then wait for the newly revealed content before capture.

The target element is outside the viewport

For a targeted screenshot, use the browser tool’s element-capture behavior. Puppeteer’s documented element screenshot scrolls a hidden element into view, but lazy-loaded content may still need the site’s normal scroll trigger before it exists.

The ready selector times out

Verify the selector against the actual page, including whether it is inside a frame or appears only after consent or another interaction. If the condition is correct but the page is variable, raise the timeout only as far as the workflow needs; do not hide a wrong selector behind a longer delay.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance and reliability considerations

Waiting only for the condition you need avoids making every capture depend on unrelated page activity. Network-idle waits can be unsuitable for pages with persistent connections, while an overly broad readiness predicate can wait for content irrelevant to the screenshot. Set explicit timeouts, close browser instances in cleanup paths, and make sure full-page or element capture matches the output you plan to process. These are workflow trade-offs, not a performance ranking of the tools.

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.

Frequently Asked Questions

Does the browser’s load event mean all JavaScript has finished?

No. It is a document lifecycle milestone, not a universal signal that every application update or delayed visual element is complete.

Should I use a fixed sleep before every screenshot?

Usually not. A condition tied to the desired page state adapts better than a pause that may be too short or unnecessarily long.

Can I capture only one part of a page?

Yes. Use an element screenshot where your browser automation library supports it; Puppeteer documents this for an element handle.

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

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.