Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesUse Puppeteer’s page.screenshot() method with type: 'jpeg' and a filename ending in .jpg to save an HTML page as a JPEG. Set quality from 0 to 100 if you want to control JPEG compression, and use fullPage: true for a full-document capture.
Generate and save a JPEG screenshot
The example below launches Chromium, opens a page, waits for a navigation condition, captures the full page as a JPEG, and closes the browser even if capture fails. The option combination is based on Puppeteer’s documented API; it is illustrative rather than a tested run.
As an Amazon Associate I earn from qualifying purchases.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle2' });
await page.screenshot({
path: 'page.jpg',
type: 'jpeg',
quality: 85,
fullPage: true,
});
} finally {
await browser.close();
}
The core flow—launch, create a page, navigate, take a screenshot, and close the browser—is shown in the Puppeteer screenshots guide. Its navigation wait is an example, not a guarantee that every application has finished rendering the content you need.
Recommended Free Tools
Choose the output and capture area
JPEG format and quality
Set type: 'jpeg' to select JPEG explicitly. Puppeteer also documents png and webp as screenshot formats; the intended format can be inferred from the output path extension, but specifying the type makes your choice clear. The ScreenshotOptions reference documents quality as a value from 0 to 100. It applies to JPEG, not PNG, and the API does not identify a universally best value. Choose a value for your use case and inspect the resulting image.
#1 Best Overall
Viewport, full page, or a clipped region
- Omit
fullPageor set it tofalseto capture the current viewport; false is the documented default. - Set
fullPage: trueto capture the full page. - Use
clipwhen you need a defined region. Puppeteer documentscaptureBeyondViewportas defaulting to false when there is no clip and true otherwise.
The options reference describes these capture controls. If you are choosing between JPEG, PNG, and WebP, the documentation establishes the available formats and controls, but does not publish comparative file-size or visual-quality measurements.
Save to disk or use the returned image data
Providing path writes the screenshot to that location. Without a path, page.screenshot() returns image data as a Uint8Array by default; the API also supports returning a base64 string when base64 encoding is requested. See the Page.screenshot() method reference.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Capture just one HTML element
Use the element’s handle when the desired output is a component rather than the page or a clipped viewport region:
Crashes, 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 minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallconst element = await page.$('.product-card');
if (!element) {
throw new Error('Could not find .product-card');
}
await element.screenshot({
path: 'product-card.jpg',
type: 'jpeg',
quality: 85,
});
Puppeteer’s screenshots guide says an element screenshot scrolls the element into view if it is hidden. The element screenshot API reports an error if the handle is detached, so make sure the element still belongs to the page when you capture it.
Rank #3
Make the captured state predictable
A screenshot records what the page has rendered at capture time. Wait for the state you actually need—not just navigation to finish. Puppeteer’s guide uses waitUntil: 'networkidle2' in its navigation example, but a navigation wait condition alone does not guarantee that application-specific content, delayed images, or an interaction-dependent state is ready. When needed, wait for a meaningful selector or perform the interaction before taking the screenshot.
Troubleshooting
- The saved file is not JPEG: use
type: 'jpeg'and a.jpgpath. The type can be inferred from the extension, but setting both avoids ambiguity. - The page is incomplete: wait for the relevant content or application state before calling
screenshot(). A navigation wait condition is not proof that all desired content has appeared. - The element capture throws: verify the selector found an element and that it has not been removed from the page before the screenshot call.
- Quality has no effect:
qualityis a JPEG option and does not apply to PNG. - No file appears: check that the screenshot call has a writable
path. Without one, Puppeteer returns image data rather than saving a file.
Or skip the browser setup
ScreenshotNeo provides a screenshot API: one GET request can return a screenshot or PDF. Its capture flow accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; those steps can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. It also offers an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents and other MCP clients.
Example request (see the ScreenshotNeo API documentation):
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. See ScreenshotNeo for the service details. Sign up for 1,000 free screenshots a month with no card.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Documentation version
The Puppeteer API references consulted displayed version 25.12.0. Puppeteer’s documentation is rolling, so check the linked API pages for the current reference when applying this code to a later release.
Quick Recap
Best Value
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.

