Free tools Windows power users keep installed
One-click scans. No signup required.
Use page.screenshot({ clip: { x, y, width, height } }) to capture a rectangular area, or call screenshot() on an element handle when the area is a specific DOM element. The examples below follow Puppeteer 25.12.0 documentation.
Capture a rectangle with clip
Set x and y to the rectangle’s top-left coordinates, then provide its width and height. These example values need to be adjusted to the page and area you want to capture.
As an Amazon Associate I earn from qualifying purchases.
await page.screenshot({
path: 'area.png',
clip: { x: 100, y: 80, width: 400, height: 250 },
});
clip describes a page region. Its type, ScreenshotClip, extends BoundingBox and includes an optional scale that defaults to 1. The screenshot option captureBeyondViewport defaults to false when no clip is set and true when one is set; a clip therefore does not by itself mean capture is limited to the visible viewport.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsCapture a specific DOM element
If the target is a single element identified by a selector, use an element handle’s screenshot() method instead of calculating rectangle coordinates manually.
#1 Best Overall
const element = await page.waitForSelector('.target');
await element.screenshot({ path: 'element.png' });
Puppeteer’s guide says that, by default, ElementHandle.screenshot() tries to scroll the element into view if it is hidden. This method is useful when the target is represented by one DOM node; use a page clip for a geometric area that is not.
Choose the capture target
| Need | Use | Why |
|---|---|---|
| A rectangle defined by coordinates | page.screenshot({ clip }) |
Set the region’s x, y, width and height. |
| A particular DOM node | ElementHandle.screenshot() |
Capture the selected element without manually specifying a rectangle. |
Save or consume the screenshot
Providing path writes the image to disk, and Puppeteer infers the image format from the file extension. PNG is the default. Without a path, Page.screenshot() returns image data as a Promise<Uint8Array>; the base64 encoding overload returns a string. JPEG quality can be set from 0 to 100. The quality option does not apply to PNG.
Rank #2
Troubleshoot common issues
- The captured region is misplaced or the wrong size: Recheck the clip’s coordinates and dimensions against the page you are capturing. The sample numbers are illustrative, not universal.
- The screenshot includes content beyond the visible viewport: A clip changes the default for
captureBeyondViewporttotrue. Set that option explicitly if you need different behavior. - No file appears: Confirm that you supplied a
path. Without one, the screenshot data is returned to your code rather than saved automatically. - A selected element is not initially visible:
ElementHandle.screenshot()attempts to scroll a hidden element into view by default. Ensure the selector resolves to the element you intend to capture. - JPEG quality has no effect: The quality setting does not apply to PNG; use an appropriate output format if you need JPEG quality control.
Or skip the browser setup
If you need a screenshot without writing and running Puppeteer capture code, ScreenshotNeo can return an image or PDF through one GET request. Cookie banners are accepted and removed along with supported popups and chat widgets before the shot; those steps can be turned off. Bot checks, blank pages, failed loads and cache hits are not billed, with response headers reporting the page verdict and billing status. ScreenshotNeo also provides an MCP server for AI agents, and includes 1,000 shots a month free with no card; paid plans start at $5 for 3,000 shots. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Sign up for 1,000 free screenshots a month, with no card required.
Quick Recap
Rank #4
Rank #3
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.




