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

Click the button, wait for the page state you need to appear, then call page.screenshot(). If the click navigates, start page.waitForNavigation() and the click together in Promise.all() so navigation cannot happen before Puppeteer begins waiting.

Capture a screenshot after a button click

For a button that changes the current page without navigating, use a specific locator and capture after the click:

await page.locator('button.save').click();
await page.screenshot({ path: 'after-click.png' });

This is sufficient only if the click has completed the change that should appear in the image. If the interface updates asynchronously, wait for an observable result before taking the screenshot.

Wait for an in-page update

await page.locator('button.save').click();
await page.waitForSelector('.success-message', { visible: true });
await page.screenshot({ path: 'success.png' });

Replace .success-message with a selector that represents the state your application should show. A selector is application-specific; there is no universal selector for a successful click.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
HP OmniBook 3 17.3 inch Laptop PC, FHD Display, AMD Ryzen 3 30, 8 GB RAM, 512 GB SSD, AMD Radeon 610M Graphics, Windows 11 Home, Mica Silver, 17-dp0199nr
  • 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

Wait for navigation

When clicking the button navigates to another page, start the navigation wait before the click can trigger navigation:

const [response] = await Promise.all([
  page.waitForNavigation(),
  page.locator('button.continue').click(),
]);
await page.screenshot({ path: 'after-navigation.png' });

Do not await the click and only then call waitForNavigation(): navigation may already have occurred, leaving the wait too late. Choose navigation wait options that fit the site; not every button click navigates.

Choose the wait that matches the result

What the click does What to wait for What to capture
The page navigates page.waitForNavigation() started in the same Promise.all() as the click page.screenshot()
The current page updates A meaningful selector with page.waitForSelector(), or a page condition with page.waitForFunction() page.screenshot()
Only one component matters Wait for the target element The element’s screenshot() method

Wait for a selector

page.waitForSelector(selector, options) waits for a selector and returns immediately if it already exists. Use options such as visible: true or hidden: true when mere presence is not enough. The documented default timeout is 30 seconds; set a different timeout for the call or configure Page.setDefaultTimeout(). See the Puppeteer API reference for waitForSelector.

Rank #2
HP 14" HD Chromebook Laptop for Students, Intel Quad-Core N4120(> N4020), 4GB RAM, 64GB eMMC, WiFi, Webcam, HDMI, USB-A&C, 14 Hours Battery Life, Zoom, Chrome OS, CUE Accessories
  • 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.
  • 14" HD Display: 14.0-inch diagonal, HD (1366 x 768), micro-edge, anti-glare. See your digital world in a whole new way. Enjoy movies and photos with the great image quality and high-definition detail of 1 million pixels.
  • Memory & Storage: 4 GB LPDDR4x & 64 GB eMMC Storage. Adequate high-bandwidth RAM to smoothly run multiple applications and browser tabs all at once. An embedded multimedia card provides reliable flash-based storage.
  • Ports:2 x USB 3.0 Type-A,1 x USB 3.0 Type-C,1 x HDMI,1 x Headphone Jack
  • Chrome OS: Chromebook is a computer for the way the modern world works, with thousands of apps. Enjoy the seamless simplicity that comes with Google Chrome and Android apps, all integrated into one laptop. It’s fast, simple, and secure.

Wait for a page condition

Use page.waitForFunction() when readiness is better described by a truthy condition evaluated in the page, rather than by one element’s appearance. It supports arguments passed from Node.js. For example, a test can wait for an application-specific state flag or a rendered value to reach the expected state. See Puppeteer’s waitForFunction API.

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

Prefer a condition that proves the page is ready for the screenshot over a fixed delay: sleeping for an arbitrary interval does not establish that a network response, animation, or application update has finished.

Select the intended button reliably

Puppeteer’s guide recommends locators for selecting and interacting with elements. A locator click waits for useful preconditions: the element is in the viewport, visible and enabled, and its bounding box is stable across two animation frames. Locators accept CSS selectors and Puppeteer-specific syntax, including text- and accessibility-based selectors. See Page interactions | Puppeteer.

Rank #3
Sale
AKCHART 15.6'' AI Laptop with Office 365 12GB RAM 256GB SSD Win 11 Laptops
  • 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.
await page.locator('button.save').click();

Make the selector specific enough to identify the intended control. The documented page.click(selector) API remains available; it scrolls the first matching element into view if needed and clicks its center. If several elements match, a page-level click acts on the first match. See the Page.click API reference.

Capture the page or just the clicked result

Save a page screenshot

Page.screenshot() captures the page. Use path to write it to a file:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.screenshot({ path: 'page.png' });

By default, the screenshot result is a Uint8Array. Set encoding: 'base64' when the caller needs a base64 string instead. Refer to Puppeteer’s Page.screenshot API reference for the available options.

Rank #4
HP Essential Laptop 2026, Intel CPU, 128GB Storage, Office 365, Windows 11
  • 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.

Save one element

When the evidence needed is limited to a component, wait for it and use its element screenshot method:

const result = await page.waitForSelector('.result', { visible: true });
if (!result) {
  throw new Error('Result element was not found');
}
await result.screenshot({ path: 'result.png' });

An element handle’s screenshot method attempts to scroll the element into view if it is hidden. Checking the returned handle matters when a wait configuration can produce null, such as waiting for a hidden selector that is not found. See ElementHandle.screenshot.

Common problems and fixes

  • The screenshot shows the old state: the click completed, but the UI update did not. Wait for a selector or a waitForFunction() condition that represents the rendered result, then capture.
  • The navigation wait times out or misses the transition: ensure waitForNavigation() is created in the same Promise.all() as the click, before navigation starts. Also confirm that this click is expected to navigate at all.
  • The wrong button is clicked: tighten the locator or selector so it uniquely identifies the intended control. A selector matching multiple elements can make page-level clicking target the first match.
  • A locator or selector wait times out: verify the selector and the expected page state. Locator actions inherit page timeout settings and can have a per-locator timeout; selector waits document a 30-second default, configurable per call or with Page.setDefaultTimeout().
  • Element capture fails after a hidden wait: handle the possibility that waitForSelector() returned null before calling screenshot() on the result.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Version context

The API material cited here includes Puppeteer’s current documentation, and the Page.click search result identified version 25.12.0. That version label should not be read as a claim that every API or behavior described here was introduced in 25.12.0. Check the documentation matching the Puppeteer version installed in your project, especially if an option or method differs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
HP 14‘’ Laptop, 2027 Edition, Intel N150 CPU, 4GB RAM, 128GB SSD, Copilot AI, 1TB Cloud Storage, Win 11 with Microsoft 365
  • Designed for mobility with a slim 0.71-inch profile and lightweight, making it easy to carry between home, office
  • 【Versatile Connectivity】Stay connected with multiple ports including USB 3.0 Type-C, USB 3.0 Type-A, HDMI, and a headphone/mic combo jack, with Wi-Fi and Bluetooth for seamless wireless networking.

Or skip the browser setup

If you need a screenshot from a URL rather than a Puppeteer interaction flow, ScreenshotNeo offers a website screenshot API. For an endpoint and parameter reference, see the ScreenshotNeo documentation.

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

ScreenshotNeo removes cookie 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. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.

Sign up for ScreenshotNeo’s free plan.

Frequently Asked Questions

Can I screenshot only the element that changed after the click?

Yes. Wait for the target element, then call its element handle’s screenshot() method instead of capturing the full page.

Does a Puppeteer screenshot return an image file automatically?

It returns screenshot data by default as a Uint8Array; specify the path option to save it directly to a file.

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.

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.