Recommended Free Tools
Use await page.waitForSelector(selector) before calling Puppeteer’s screenshot method. Add { visible: true } when the target must be visible, then call page.screenshot() for the page or ElementHandle.screenshot() for just the matched element.
Wait for the selector, then capture
This example waits until .target is present and visible, captures that element, and disposes of its handle:
As an Amazon Associate I earn from qualifying purchases.
const element = await page.waitForSelector('.target', { visible: true });
if (!element) {
throw new Error('Target element was not found');
}
try {
await element.screenshot({ path: 'target.png' });
} finally {
await element.dispose();
}
waitForSelector() returns an ElementHandle for a match. The null check is defensive for code that may change its wait options; with the visible wait shown here, a timeout normally throws instead. The Puppeteer API reference documents the method and its options.
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 →Choose presence or visibility
By default, waitForSelector() waits for the element to exist in the DOM. That does not necessarily mean a user can see it. Set { visible: true } to require both DOM presence and visibility. Conversely, { hidden: true } resolves when the element is hidden or absent; that wait can return null because there is no visible element handle to capture.
#1 Best Overall
CSS selectors work directly. Puppeteer also supports selector syntax for text, accessibility role and name, XPath, and combinations that can cross shadow roots. See the selector and wait options reference for details.
Capture the whole page or one element
Capture the page after the target appears
Use the wait as a readiness condition, then call page.screenshot():
Rank #2
await page.waitForSelector('.target', { visible: true });
await page.screenshot({ path: 'page.png', fullPage: true });
fullPage: true captures the full page; it defaults to false. Use clip when you need a specific capture region. Puppeteer can infer the image format from the path extension. Options are described in its screenshots guide and ScreenshotOptions reference.
Free tools Windows power users keep installed
One-click scans. No signup required.
Capture only the matched element
Call element.screenshot() on the handle returned by the wait. Puppeteer scrolls the element into view if needed. If the element is detached from the DOM before the screenshot, the capture throws. The ElementHandle screenshot reference covers this behavior.
Set a timeout and handle failures
The documented default timeout is 30 seconds. If the selector does not match before the timeout, Puppeteer throws rather than continuing to the screenshot. You can set a per-wait timeout, change the page default with Page.setDefaultTimeout(), or set timeout: 0 to disable the timeout. An AbortSignal can also cancel the wait. Prefer a finite timeout in automation so a missing target does not leave a capture hanging indefinitely.
const element = await page.waitForSelector('.target', {
visible: true,
timeout: 10_000,
});
The 10-second value here is an example choice, not Puppeteer’s default. Choose a limit that fits the site and your workflow.
Rank #4
Common failures and fixes
- The wait times out: Check that the selector is correct and that the page has reached the state where the element is inserted. If visibility is not actually required, remove
visible: true; otherwise, inspect why the target remains hidden. - The wait succeeds but the screenshot fails: The element may have been detached between the wait and capture. Re-query or retry the workflow around the page’s update, and avoid assuming a saved handle remains valid after the DOM changes.
- The page shot is too short: Set
fullPage: trueif you need the full document rather than the current viewport. - The capture includes the wrong area: Use the returned handle’s screenshot for just the element, or configure
clipfor a page screenshot region. - Handles accumulate in a long-running script: Dispose of each returned
ElementHandlewhen finished, such as in afinallyblock.
When to use a locator instead
Puppeteer’s current page-interactions guide recommends locators for selecting and interacting with elements because locators wait for action preconditions. waitForSelector() is a lower-level API and does not automatically retry an action. It remains a direct choice when you need the returned handle itself for ElementHandle.screenshot(). See the page interactions guide.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesOr skip the browser setup
If you need a screenshot without managing a Puppeteer browser, ScreenshotNeo returns an image or PDF from one GET request. It can wait for a selector, and its clean-shot workflow accepts cookie or consent banners and removes supported 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, with page verdict and billing information in response headers. Its MCP server provides screenshot tools for AI agents.
Example cURL request, with the API key and target URL replaced as appropriate:
Best Value
- Used Book in Good Condition
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo documentation for the API parameters, including selector waits. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for free.
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.




