If a Puppeteer screenshot no longer lines up with the page after scrolling, first identify whether you call page.screenshot() or elementHandle.screenshot(). The latter scrolls its target into view when needed before taking the image. Then check the screenshot options, viewport setup, and whether the page’s layout changes after scrolling. These checks narrow down likely causes; without your capture code and page behavior, there is no universal one-line fix.
1. Identify the screenshot method and its options
Log the exact call that produces the misaligned image. A page screenshot and an element screenshot do not have the same capture target or scroll behavior.
| Capture call or option | What it means for diagnosis |
|---|---|
page.screenshot() |
Captures the page using the supplied screenshot options. Check whether you intend to capture the current viewport or a larger page region. |
elementHandle.screenshot() |
Captures an element. Puppeteer documents that it scrolls the element into view if needed, then uses Page.screenshot() to take the element image. If your code scrolls first, this additional implicit scroll may matter. |
fullPage |
When true, requests a full-page capture; its default is false. |
clip |
Specifies a rectangular region to capture. Verify that its coordinates and dimensions match the coordinate space you intend to use. |
captureBeyondViewport |
Controls capture outside the viewport. Its default is false without a clip and true when a clip is supplied. |
Choose options to match the artifact you want: a viewport image, a full-page image, or a clipped region. Avoid combining assumptions from one capture mode with another. See the official screenshot options, Page.screenshot(), and ElementHandle.screenshot() documentation. The cited references were surfaced as Puppeteer 25.12.0; check the documentation for your installed version because options and defaults can change.
2. Check viewport setup and scroll position
Record the viewport dimensions and configuration immediately before capture, along with the page’s scroll position and the target element’s bounding box. Compare those values for a capture before scrolling and one after scrolling. This is a debugging technique, not a guarantee about Puppeteer’s internal coordinate handling.
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
- 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.
- Set the intended viewport before navigating where possible. Puppeteer recommends this because some sites do not expect their viewport to change after loading.
Page.setViewport()resizes the page, and certain mobile or touch settings can trigger a reload. - Keep the viewport dimensions and device scale consistent between navigation and capture. Treat consistency as a diagnostic control: change one factor at a time so you can identify whether the capture setup contributes to the shift.
- Log the scroll position and target bounding box directly before the screenshot. If either changes between the expected and actual capture moment, investigate the page’s behavior as well as Puppeteer’s options.
See Puppeteer’s viewport documentation for Page.setViewport() behavior and its recommendation about setting the viewport before navigation.
3. Check for layout changes triggered by scrolling
A page can move or reflow after a scroll for reasons unrelated to the screenshot call. Inspect the specific page for sticky headers, lazy-loaded content, animations, responsive breakpoints, and scroll-triggered DOM updates. These are possibilities to verify, not causes established for every misaligned Puppeteer screenshot.
Wait for a page-specific condition that indicates the relevant content is ready. For example, wait for the target element to appear or for an application state to be reached. Puppeteer locators can scroll elements and wait for stable bounding boxes over two consecutive animation frames before acting, but that behavior is not documented as a universal guarantee that all page layout has settled for a screenshot. See the page interactions guide.
Rank #2
- 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.
4. Inspect implicit scrolling for element captures
If you capture an element, decide whether Puppeteer should scroll it into view. ElementScreenshotOptions includes scrollIntoView, which defaults to true. If your code already scrolls the page, test the element capture with that behavior accounted for; otherwise the screenshot operation may perform another scroll before capturing.
Use ElementScreenshotOptions to confirm the option and default in the Puppeteer version installed in your project.
Rank #3
- 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.
5. A minimal diagnostic pattern
Compare a screenshot before and after scrolling while recording the capture configuration. Adapt this pattern to your selectors and page readiness condition; it deliberately does not assume what causes the shift.
const beforeViewport = page.viewport();
const beforeScrollY = await page.evaluate(() => window.scrollY);
const beforeBox = await page.$eval('#target', el => {
const r = el.getBoundingClientRect();
return { x: r.x, y: r.y, width: r.width, height: r.height };
});
console.log({ beforeViewport, beforeScrollY, beforeBox });
await page.screenshot({ path: 'before.png', fullPage: false });
await page.evaluate(() => window.scrollTo(0, 600));
// Replace this with the page-specific condition that signals readiness.
await page.waitForSelector('#target');
const afterViewport = page.viewport();
const afterScrollY = await page.evaluate(() => window.scrollY);
const afterBox = await page.$eval('#target', el => {
const r = el.getBoundingClientRect();
return { x: r.x, y: r.y, width: r.width, height: r.height };
});
console.log({ afterViewport, afterScrollY, afterBox });
await page.screenshot({ path: 'after.png', fullPage: false });
This example uses a viewport-only page screenshot. If the intended output is an element capture, a clipped region, or a full-page image, use the corresponding method and options instead of treating this diagnostic as a universal capture recipe.
Rank #4
- 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
6. Common symptoms and next checks
| Symptom | Check next |
|---|---|
| The target appears at a different position in an element screenshot | Check whether elementHandle.screenshot() scrolls it into view and whether scrollIntoView is enabled. |
| The image includes more or less page content than expected | Check fullPage, clip, and captureBeyondViewport together, using defaults for your installed version. |
| The layout changes between scroll and capture | Inspect scroll-triggered page behavior and wait for an application-specific ready condition; a stable bounding box for two animation frames does not prove every source of layout change has ended. |
| Results differ after a viewport change | Set the viewport before navigation where possible, and check whether mobile or touch settings caused a reload. |
| The cause remains unclear | Compare the exact capture call, options, viewport, scroll position, target bounds, page behavior, and Puppeteer/browser versions. The documentation alone cannot determine which factor is responsible in a particular application. |
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. Its one-request API can capture a URL as a PNG, JPEG, WebP, or PDF. For example, this cURL request saves a WebP screenshot of Stripe; see the ScreenshotNeo API documentation for setup and options:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie or consent banners 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 or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and each response identifies the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.
Sign up free for 1,000 screenshots a month, with no card required.
Best Value
- 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
Can Puppeteer’s locator stability check guarantee that a screenshot will not shift?
No. The documented check waits for a stable bounding box over two consecutive animation frames before an action; it is not a universal screenshot-settling guarantee.
What information is needed to identify the cause in a specific project?
The capture code and options, page behavior, Puppeteer and browser versions, viewport configuration, and the state of the page around the scroll and capture.
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 →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.

