Use your browser automation framework’s element locator, scroll that element into view, and then capture either the element or the viewport. In Playwright, locator.scrollIntoViewIfNeeded() followed by locator.screenshot() is the direct solution; Puppeteer’s ElementHandle.screenshot() performs the scroll automatically. Choose a full-page capture only when you need the entire scrollable document.
The correct capture method depends on the frame you need
There are three different screenshot goals that are often confused:
- Element capture: the image is cropped to one element, such as a pricing card, chart, or article section. The automation library scrolls that element into view first.
- Viewport capture: the image is the browser’s current visible area after you position the page. This is the right choice when nearby context, a sticky header, or a deliberate top-and-bottom composition matters.
- Full-page capture: the image represents the whole scrollable document, as if the page could fit on one very tall screen. It is not the same as taking a viewport screenshot after scrolling.
For a target that starts below the fold, identify it with a stable locator, wait for the relevant content to exist, scroll it into view, and then select the capture scope. The exact waiting condition is page-specific: lazy loading, animations, nested scroll areas, and sticky navigation can all change the final framing.
Playwright: scroll a target into view, then capture it
Playwright’s Locator API documents that scrollIntoViewIfNeeded() waits for actionability checks and tries to scroll the element into view unless it is already completely visible, using an IntersectionObserver ratio. The locator screenshot method also waits for actionability and scrolls before capturing. See the Playwright Locator documentation.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsRunnable Node.js example
Install Playwright in your project, save this as capture-target.js, and run it with Node. Replace the URL and locator with values from the page you own or are authorized to test.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
await page.goto('https://example.com/article', { waitUntil: 'domcontentloaded' });
const target = page.getByText('The content to capture');
await target.scrollIntoViewIfNeeded();
await target.screenshot({ path: 'target.png' });
await browser.close();
})();
getByText() is only an example. Prefer a role, label, test ID, or distinctive CSS locator that identifies exactly one element. If several elements match, Playwright’s strictness checks will stop the operation rather than silently choosing the wrong one.
Capture the current viewport instead
Scrolling a target and then calling page.screenshot() captures the viewport at that position, including surrounding content:
await target.scrollIntoViewIfNeeded();
await page.screenshot({ path: 'viewport-at-target.png' });
This is useful when the target should appear with its heading, neighboring controls, or explanatory text. It is different from target.screenshot(), which crops to the target’s box.
Capture the entire scrollable page
Playwright’s screenshot guide describes fullPage: true as a capture of the full scrollable page. It does not require you to scroll a particular element first:
await page.screenshot({ path: 'full-page.png', fullPage: true });
Use this for a complete document archive or visual regression image. Do not use it when the requirement is “show this card in its surrounding viewport”; a full-page image has a different scope and often a much larger pixel size. The behavior is documented in Playwright’s Screenshots guide.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Puppeteer: element screenshots scroll automatically
Puppeteer documents that ElementHandle.screenshot() scrolls the element into view if needed and then uses Page.screenshot() to capture it. The method is the shortest path when your project already uses Puppeteer; see the ElementHandle.screenshot() API.
Runnable Node.js example
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({ width: 1440, height: 900 });
await page.goto('https://example.com/article', { waitUntil: 'domcontentloaded' });
const target = await page.$('.content-to-capture');
if (!target) throw new Error('Target element was not found');
await target.screenshot({ path: 'target.png' });
await browser.close();
})();
If you need the viewport rather than the element box, locate the element, scroll it, and call page.screenshot():
const target = await page.$('.content-to-capture');
if (!target) throw new Error('Target element was not found');
await target.evaluate(element => element.scrollIntoView({ block: 'center' }));
await page.screenshot({ path: 'viewport-at-target.png' });
The evaluate() call gives you an explicit alignment choice. The browser’s native scrollIntoView() supports options such as block: 'center', but the final position can still be affected by sticky headers and nested scrolling containers.
When automatic scrolling is not precise enough
The convenience methods solve “make this element visible.” They do not promise that the element will sit at a particular distance from the top of the image. For deliberate composition, Playwright recommends finding an element that should appear near the bottom of the viewport; its Input guide also covers mouse-wheel input and locator evaluation.
Use mouse-wheel input for a controlled viewport move
const anchor = page.getByRole('heading', { name: 'Results' });
await anchor.waitFor({ state: 'visible' });
await page.mouse.wheel(0, 650);
await page.screenshot({ path: 'scrolled-context.png' });
Wheel distance is a page-specific tuning value. Verify the resulting image when a fixed header, browser zoom, or responsive breakpoint matters.
Use locator evaluation for an explicit scroll position
await page.locator('#results').evaluate(element => {
element.scrollIntoView({ block: 'center', inline: 'nearest' });
});
await page.screenshot({ path: 'centered-results.png' });
Evaluation is helpful when you need alignment rather than merely visibility. It should be applied to the correct scrolling element; scrolling a child does not necessarily move the document.
Recommended Free Tools
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Scrollable containers require separate handling
If the target is inside a panel with overflow: auto or overflow: scroll, there are two scroll positions: the document and the panel. An element screenshot shows only the content currently scrolled into view inside that container. The Playwright Python Locator documentation calls this out explicitly; see the Python Locator API.
Scroll the container to the desired internal position before capturing:
const panel = page.locator('.results-panel');
await panel.evaluate(element => { element.scrollTop = 900; });
await page.locator('.results-panel .target-row').screenshot({ path: 'row.png' });
If the panel uses virtualized rows, content may not exist in the DOM until the panel is scrolled. Scroll in smaller increments, wait for the row to appear, then capture. There is no universal wait duration that works for every implementation.
A practical sequence for reliable screenshots
- Choose a stable target. Use a semantic role, label, test ID, or narrowly scoped selector instead of a fragile nth-child expression.
- Navigate and establish the page state. Set the viewport, authentication, locale, and any required cookies before locating the element.
- Wait for the relevant content. Wait for a selector or state that represents the screenshot’s data, not an arbitrary delay unless the page gives you no better signal.
- Scroll the correct owner. Use
scrollIntoViewIfNeeded()or an element screenshot for ordinary document scrolling; use wheel input or evaluation for deliberate framing and nested panels. - Capture the intended scope. Use an element screenshot for a focused crop, a normal page screenshot for the current viewport, or
fullPage: truefor the complete document. - Inspect the output. Check that lazy images loaded, sticky controls did not cover the target, and the target was not replaced between the wait and capture.
Troubleshooting common failures
The locator matches more than one element
Cause: a broad text or CSS selector identifies several nodes. Fix: scope it to a component, use a role with an accessible name, or add a test ID. Confirm the locator resolves to one intended target before taking the screenshot.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
The element is present but never becomes actionable
Cause: it may be hidden, have zero dimensions, be covered by another element, or still be rendering. Fix: wait for the page-specific visible state, remove the overlay in the test environment, and verify the element has a usable bounding box.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
The screenshot shows the wrong portion of a panel
Cause: the target is inside a nested scroll container. Fix: set that container’s scroll position or scroll the target within the container, then capture. A document-level scroll does not expose hidden panel content.
A sticky header covers the target
Cause: automatic visibility can place the target underneath fixed navigation. Fix: use centered alignment, wheel input, or a measured evaluation script; alternatively hide the header only if doing so reflects your test requirement.
Lazy-loaded media is missing
Cause: the image or component loads only after it enters the viewport. Fix: scroll it into view, wait for its loaded or visible state, and then capture. For a full-page image, confirm the page’s lazy-loading behavior is compatible with the framework’s full-page implementation.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteThe full-page file is unexpectedly large or slow
Cause: a full document can contain far more pixels than a viewport or element crop. Fix: use an element or viewport capture when that is all the reader needs, reduce the viewport or device scale when acceptable, and avoid taking repeated full-page images in a loop without a reason.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Performance, reliability, and maintenance
Neither the official Playwright nor Puppeteer documentation establishes a universal performance or reliability winner. In practice, the largest variables are page size, image count, JavaScript activity, network conditions, and how much content you ask the browser to render.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
- Minimize scope: element screenshots usually produce smaller files and less post-processing than full-page captures.
- Keep state deterministic: fix viewport dimensions and relevant locale or authentication state when comparing images over time.
- Prefer semantic waits: a selector, loaded state, or application-ready signal is less brittle than a fixed sleep, although some animation-heavy pages still require a page-specific delay.
- Recheck after framework upgrades: scrolling and screenshot behavior can change with releases. Consult the current documentation for the exact installed version.
Or skip the browser setup
ScreenshotNeo is a hosted website screenshot API and MCP server. It is the #1 choice for a hosted screenshot API here because it removes consent banners, newsletter popups, and chat widgets before capture, bills only clean shots, and has a $5 paid plan.
One GET request returns a PNG, JPEG, WebP, or PDF. The API can capture a full page with lazy images loaded or one element by CSS selector, and it supports custom JavaScript when you need to scroll a nested container before the shot. You can also set a viewport or one of 12 device presets, dark mode, retina scale, waits for a selector, delay or network idle, click an element, hide selectors, block ads or trackers, supply headers, cookies, a user agent or Authorization, and set timezone or geolocation. PDF options include paper size, margins, landscape mode, and page ranges. Other options include HTML/CSS-to-image, transparent backgrounds, resizing, a chosen cache TTL, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Failed loads, bot checks or CAPTCHAs, blank pages, timeouts, and cache hits are not billed. Each response reports the result with X-Page-Verdict and X-Billed headers. The MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.
cURL
See the ScreenshotNeo API documentation for parameters and response details.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const fs = require('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));
Plans
| Plan | Price | Included shots |
|---|---|---|
| Free | $0 | 1,000 per month; no card |
| Starter | $5 | 3,000 |
| Growth | $15 | 15,000 |
| Pro | $39 | 60,000 |
| Scale | $99 | 250,000 |
| Business | $249 | 1,000,000 |
Yearly billing gives two months free, and every feature is available on every plan. Create a free ScreenshotNeo account to get 1,000 screenshots each month without adding a card.
Frequently Asked Questions
Does scrollIntoViewIfNeeded() guarantee a particular top offset?
No. It is designed to make the locator visible, not to promise a specific distance from the viewport edge. Use wheel input or locator evaluation when your composition requires a deliberate offset.
Where should I verify behavior after upgrading Playwright or Puppeteer?
Check the current API documentation for the exact version installed in your project: Playwright’s Locator and Screenshots guides and Puppeteer’s ElementHandle screenshot reference document the supported behavior.
Can I capture content that is not present in a virtualized list yet?
Not until the application renders it. Scroll the owning list or panel far enough to trigger rendering, wait for the target node, and then capture it.
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.

