The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Use page.waitForSelector() to find the element, then call screenshot() on the returned element handle. Puppeteer scrolls the element into view if needed.
Capture an element by CSS selector
This runnable example saves the selected element as a PNG:
As an Amazon Associate I earn from qualifying purchases.
const element = await page.waitForSelector('.target');
if (!element) throw new Error('Target element was not found');
await element.screenshot({ path: 'element.png' });
Here, page is an existing Puppeteer Page. Replace .target with a CSS selector that identifies the element you want. The screenshot guide demonstrates this selector-to-element-handle approach: Puppeteer Screenshots guide.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Choose a selector and wait for the right element
Use a selector specific enough to identify the intended element, such as a stable class or ID. waitForSelector() waits for a match; if the target never appears, the wait can fail rather than producing an image of the wrong content. For pages that replace or rerender DOM nodes, make sure the selector resolves to the current element before capturing.
#1 Best Overall
Puppeteer recommends locators for selecting and interacting with elements because they wait for an element to be present and in the right state for an action. The screenshot guide shows the lower-level ElementHandle method used here; use waitForSelector() and an element handle when locator functionality does not meet the need for this capture workflow. See Puppeteer page interactions.
Set output and screenshot options
pathwrites the screenshot to a file; Puppeteer infers the image format from the extension.typelets you specify the image format explicitly.omitBackgroundcan omit the default background for transparency where supported.clipsets a capture region, but for a selected element,ElementHandle.screenshot()already targets that element.fullPageis a page-wide option; it is not needed to capture only the selected element.- PNG ignores the
qualitysetting.
For example, to receive bytes instead of writing a file, omit path; ElementHandle.screenshot() returns image bytes by default. Set encoding: 'base64' if you specifically need a base64 string. Check the ScreenshotOptions reference for the supported options.
Rank #2
Or skip the browser setup
For a hosted capture, ScreenshotNeo can return a screenshot with one GET request. It is a screenshot API and MCP server for developers. Its clean-shot steps accept cookie or consent banners like a visitor and remove 60+ known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with the page verdict and billing status reported in response headers.
Recommended Free Tools
cURL:
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)
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}`);
See the ScreenshotNeo API documentation for setup and request options. Its MCP server lets AI agents—including Claude, Cursor, and other MCP clients—use take_screenshot, get_page_info, and capture_pdf. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.
Sign up for 1,000 free screenshots a month—no card required.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Frequently Asked Questions
Does the element screenshot include content outside the element?
No. It captures the selected element, rather than the whole page.
Can I get a base64 result instead of a file?
Yes. Omit path for image bytes, or set encoding: 'base64' for a base64 string.
Quick Recap
Best Value
Rank #4
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.




