Set the viewport or emulate a mobile device before navigating, then use page.screenshot() to save one image per configuration. Puppeteer’s device emulation applies device metrics and a user agent; page.setViewport() is the simpler choice when you only need chosen CSS dimensions. The examples below capture both layouts in separate files.
Capture desktop and mobile screenshots with Puppeteer
This Node.js example uses Puppeteer’s ESM imports and a named device descriptor. The desktop dimensions and device are examples, not universal breakpoint recommendations. Replace the URL, dimensions, or device with the configurations you need.
As an Amazon Associate I earn from qualifying purchases.
import puppeteer, {KnownDevices} from 'puppeteer';
const browser = await puppeteer.launch();
try {
const desktop = await browser.newPage();
await desktop.setViewport({width: 1440, height: 900});
await desktop.goto('https://example.com', {waitUntil: 'networkidle2'});
await desktop.screenshot({path: 'example-desktop.png'});
const mobile = await browser.newPage();
await mobile.emulate(KnownDevices['iPhone 17 Pro']);
await mobile.goto('https://example.com', {waitUntil: 'networkidle2'});
await mobile.screenshot({path: 'example-mobile.png'});
} finally {
await browser.close();
}
- Launch the browser and create a page for each configuration.
- Set the desktop viewport or emulate the desired device before loading the site.
- Navigate to the same URL and save each screenshot to a distinct path.
- Close the browser in a
finallyblock so it is closed even if a capture fails.
Install Puppeteer in your Node.js project if needed, then run the file using your project’s ESM setup. Puppeteer’s documented screenshot workflow is page.goto() followed by page.screenshot(); its guide uses networkidle2 as an example wait setting, not a guarantee that every page is ready. Puppeteer Screenshots guide
Choose viewport dimensions or device emulation
Use a custom viewport for responsive widths
Call page.setViewport({width, height}) when the aim is to see how the site responds to particular page dimensions. Choose widths that matter to the site’s CSS and intended audience; the Puppeteer documentation does not prescribe universal desktop or mobile breakpoints. A viewport-only setup is not a physical-device test.
#1 Best Overall
- YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
- LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
- MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
- NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
- BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
Emulate a device when device properties matter
Call page.emulate(KnownDevices['iPhone 17 Pro']) to apply the selected descriptor’s device metrics and user agent. Puppeteer recommends emulating before navigation because sites may not expect phone metrics to change after loading. Page.emulate()
Changing viewport properties after navigation can reload the page in some cases, particularly when changing isMobile or hasTouch. Set the intended conditions early. Page.setViewport()
Rank #2
- Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
- DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
- CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
- PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
- BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.
Capture the visible viewport, full page, a region, or an element
- Visible viewport:
page.screenshot({path: 'shot.png'})captures the current view.fullPagedefaults tofalse. - Whole page: use
page.screenshot({path: 'shot.png', fullPage: true})to capture beyond the visible viewport. - Specific region: use the
clipoption when you need a defined portion of the page. - One element: use
ElementHandle.screenshot(). Puppeteer attempts to scroll a hidden element into view by default.
Screenshot options also include output path, image type, quality (not applicable to PNG), and omitBackground. See ScreenshotOptions and the Screenshots guide.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Wait for the page state your capture requires
The example waits for networkidle2, but a network-idle event alone does not establish that a site’s dynamic content, lazy-loaded images, animations, or third-party widgets have finished. If a screenshot is incomplete, identify the content that must be ready and add a site-specific readiness condition before capturing. There is no single wait condition established by Puppeteer’s cited documentation as correct for every site.
Rank #3
- YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
- LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
- MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
- NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
- BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
Troubleshoot common capture problems
- Mobile screenshot looks like desktop: confirm that
emulate()or the intended viewport is set beforegoto(). A plain viewport change does not apply a device descriptor’s user agent and metrics. - Layout differs from the intended breakpoint: check the actual CSS media-query widths and capture at those widths; there is no universal breakpoint value.
- Content is missing: the selected navigation wait may have completed before the relevant dynamic content or lazy image was ready. Wait for a condition specific to that page.
- Image only shows the first screen: set
fullPage: trueif the entire page is required. - Capture fails after changing mobile settings: set device metrics before navigation rather than changing mobile or touch properties on a loaded page, which may trigger a reload.
Or skip the browser setup
ScreenshotNeo can return a website capture from one GET request. Its clean-shot workflow accepts cookie or consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. It also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
For the same URL at a chosen viewport, supply the viewport parameter as documented. The minimal cURL request is:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo API documentation for parameters, including viewport and output settings. ScreenshotNeo’s free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. ScreenshotNeo is the service’s homepage. Sign up for 1,000 free screenshots a month, with no card.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #4
- PRIVACY DISPLAY: Automatically hide your screen from those beside you. The built-in privacy display can be preset¹ to turn on when receiving notifications, typing passwords, or using specific apps
- TYPE IT IN. TRANSFORM IT FAST: Enhance any shot in seconds on your smartphone by using Photo Assist² with Galaxy AI.³ Add objects, restore details, or apply new styles by simply typing or tapping
- NIGHTS, CAPTURED CLEARLY: From gigs to city lights, record and capture moments after dark with clarity using Nightography so your photos and videos stay crisp and clear on your Samsung Galaxy
- MAKE IT. EDIT IT. SHARE IT: Turn everyday moments into something personal with creative tools built right into your mobile phone, whether it’s a special contact photo, custom wallpaper, an invitation or more⁴
- HELP THAT KEEPS UP: Stay in the moment while Now Nudge with Galaxy AI helps you respond faster and stay organized with smart suggestions⁵ that appear exactly when you need them on your phone
Frequently Asked Questions
Does Puppeteer’s mobile emulation test a real phone?
No. It emulates browser device metrics and a user agent; it is not a physical-device test.
Can I capture multiple responsive widths in one run?
Yes. Create a page for each configuration, set its viewport before navigation, and save each result with a distinct filename.
Quick Recap
Best Value
- Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Activating is easy, just 3 steps.
- ACTIVATION Promotion: Includes 1500 min, 1500 texts & 1500 MB Data + add more as you need it
- CAMERA SYSTEM: 50MP Quad Pixel camera. Capture sharper, more vibrant photos day or night with 4x the light sensitivity.
- PERFORMANCE: Blazing-fast Qualcomm performance. Get the speed you need for great entertainment with a Snapdragon 680 processor and 4GB of RAM.
- 64GB built-in storage. Get plenty of room for photos, movies, songs, and apps. Made for US
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.




