iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Use Puppeteer’s page.screenshot() to save the rendered page, or select the SVG and call element.screenshot() to capture just the graphic. Set the viewport and capture extent deliberately, and wait for the page’s actual render-ready condition rather than assuming that a generic network wait guarantees the SVG is finished.
Choose what to capture
- Whole visible viewport: call
page.screenshot()with the default viewport-sized capture. - Entire page: pass
fullPage: trueto capture beyond the viewport. - One SVG: find the SVG (or a wrapper around it) and call its element handle’s
screenshot()method. - A specific region: use the screenshot option
clipto define a rectangle.
Puppeteer screenshots capture browser-rendered output, not the original SVG source file. That means layout, CSS, fonts, external assets, and the page’s render timing can affect the result. See the Puppeteer screenshots guide and the Page.screenshot() API reference.
Install Puppeteer and run a screenshot script
In a Node.js project, install Puppeteer with npm install puppeteer. The following ES-module script navigates to a hosted SVG page, waits for an SVG, and saves both the selected graphic and the page. Replace the example URL and selector with the ones for your page.
Windows 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 reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchimport puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.setViewport({ width: 1200, height: 800 });
await page.goto('https://example.com/chart', { waitUntil: 'networkidle2' });
const svg = await page.waitForSelector('svg');
if (!svg) {
throw new Error('No SVG matched the selector');
}
await svg.screenshot({ path: 'svg-element.png' });
await page.screenshot({ path: 'svg-page.png' });
} finally {
await browser.close();
}
The script uses networkidle2 as a navigation wait, as in Puppeteer’s guide, but it is not a universal signal that every application has finished drawing. If your page exposes a meaningful ready state, wait for that state before capturing. For an SVG embedded in HTML you already have, use page.setContent(html) instead of navigating to a URL; see the Page.setContent() reference.
#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
Capture only the SVG
Use a selector that uniquely identifies the SVG you want. If the page contains several SVGs, narrow the selector—for example, #sales-chart svg—or target an SVG wrapper. waitForSelector() waits for the element to appear; it does not establish that an animated or application-rendered graphic has reached its final state.
const svg = await page.waitForSelector('#sales-chart svg');
if (!svg) throw new Error('Chart SVG not found');
await svg.screenshot({ path: 'sales-chart.png' });
Puppeteer scrolls an element into view when needed before taking its screenshot. An element capture can fail if the element is detached from the DOM before capture, so avoid rerendering or replacing it between selection and screenshot. Refer to ElementHandle.screenshot() for the method behavior.
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
Set size, extent, format, and background
Viewport and full-page output
Set the viewport before loading or capturing when the page’s responsive layout matters. The sample uses 1200 by 800 pixels; choose dimensions that match the output you need. By default, the screenshot is limited to the viewport. Set fullPage: true for the full page, or use clip when only a particular rectangle is needed.
await page.screenshot({ path: 'full-page.png', fullPage: true });
await page.screenshot({
path: 'region.png',
clip: { x: 100, y: 120, width: 600, height: 400 }
});
Screenshot options, including fullPage, clip, and captureBeyondViewport, are documented in the ScreenshotOptions reference. Use one capture scope that matches your purpose rather than expecting an element capture, viewport capture, and full-page capture to have identical dimensions.
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.
PNG and transparency
The screenshot type can be inferred from the filename extension; PNG is the documented default when no type is specified. To omit the browser’s default page background, use omitBackground: true:
await page.screenshot({
path: 'svg-transparent.png',
omitBackground: true
});
This makes the default page background transparent, but it cannot remove a background painted by the SVG itself or by page CSS. Inspect the result if you need transparency behind the graphic. The available screenshot settings are listed in the ScreenshotOptions documentation.
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
Wait for the SVG to be ready
Navigation completion and the presence of an <svg> element do not necessarily mean the final image is ready. The page may still be applying data, loading fonts or external assets, or advancing an animation. Choose a wait condition that reflects how that page works: for example, wait for an application-specific ready marker or for the data-driven content to appear. Puppeteer’s documentation does not define one universal SVG-ready condition.
For repeatable comparisons, keep the browser version, viewport, input page, and relevant assets stable. Puppeteer’s cited documentation does not promise pixel-identical output across browser versions, operating systems, or fonts.
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.
Troubleshoot common capture problems
- No SVG found: check that the selector matches the live DOM and that the page or supplied markup has loaded. Use a more specific selector if there are multiple graphics.
- Graphic is blank or incomplete: wait for the application’s actual render-ready state and any required assets. A generic navigation wait or a visible SVG node alone may not be sufficient.
- Element screenshot fails after selection: the element may have been detached during a rerender. Wait until the page settles and select the current element immediately before capture.
- Image has the wrong dimensions: verify the viewport and whether you want the viewport, full page, element, or a clipped region. Those choices determine different capture extents.
- Transparent output still has a colored area:
omitBackgroundremoves the default page background, not a background defined by the SVG or CSS. - PNG is not the expected format: check the output filename extension and any explicit screenshot type option. Puppeteer infers the format from the extension when applicable.
Or skip the browser setup
ScreenshotNeo can return a website screenshot in one GET request. For an SVG hosted on a public web page, request the URL like this (use your API key and the target page URL):
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/chart -o chart.webp
See the ScreenshotNeo documentation for request options. It removes cookie and consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots, and the Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo free.
Frequently Asked Questions
Can Puppeteer save an SVG web page as a PNG?
Yes. Save the rendered page or SVG element with a filename ending in .png; Puppeteer uses PNG as the default screenshot type.
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 errorsCan I use Puppeteer with SVG markup I already have?
Yes. Load the supplied HTML markup with page.setContent(html), then capture the page or select its SVG element.
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.

