DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk4 min

How to Capture a Mobile Website Screenshot with Puppeteer Device Emulation

A practical Puppeteer workflow for mobile device emulation, viewport and full-page screenshots, element captures, readiness checks, and common errors.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Puppeteer’s page.emulate() with a named KnownDevices preset before navigating to the site, then capture the viewport, full page, or a specific element with Puppeteer’s screenshot APIs. This creates a screenshot under browser device emulation; it is not a photograph from a physical phone.

Set up Puppeteer and emulate a mobile device

page.emulate(device) applies the device’s user-agent string and viewport metrics. Puppeteer recommends setting emulation before navigation because changing the viewport can affect how a site lays out its page. A device preset packages a user agent and viewport; it does not establish that every hardware or operating-system behavior is reproduced. See Puppeteer’s Page.emulate() documentation and the Device interface.

As an Amazon Associate I earn from qualifying purchases.

The following runnable ES module uses Puppeteer’s documented KnownDevices preset and saves a full-page PNG. Install Puppeteer in your project with npm install puppeteer, save the code as mobile-shot.mjs, and run node mobile-shot.mjs. The first run may also download a browser for Puppeteer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import puppeteer, {KnownDevices} from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.emulate(KnownDevices['iPhone 17 Pro']);
  await page.goto('https://example.com', {waitUntil: 'networkidle2'});
  await page.screenshot({path: 'mobile.png', fullPage: true});
} finally {
  await browser.close();
}

KnownDevices supplies named presets intended for page.emulate(). Pick one whose viewport and user agent match the scenario you want to test; the preset name alone does not guarantee equivalence to a particular physical handset. See Puppeteer’s KnownDevices reference.

#1 Best Overall
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • 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.

Choose the screenshot area and format

Capture only the visible viewport

For a screenshot of the current viewport, leave out fullPage:

await page.screenshot({path: 'mobile-viewport.png'});

Capture the full page

Set fullPage: true to capture beyond the viewport:

await page.screenshot({path: 'mobile-full.png', fullPage: true});

Capture a rectangular region

Use clip when you need a specific rectangle rather than the whole page or a DOM element. The clip rectangle takes coordinates and dimensions:

Rank #2
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to
  • 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.
await page.screenshot({
  path: 'mobile-region.png',
  clip: {x: 0, y: 120, width: 390, height: 500}
});

Capture one element

Find the element and call its screenshot method. Puppeteer scrolls it into view if needed; if the element has been detached from the document, the capture fails.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const card = await page.$('.product-card');
if (!card) throw new Error('Could not find .product-card');
await card.screenshot({path: 'product-card.png'});

Screenshot options also include output type, quality for supported formats, and omitBackground for a transparent background. The default image type is PNG; Puppeteer can infer the type from the output filename extension. Check Page.screenshot(), ScreenshotOptions, ElementHandle.screenshot(), and the Puppeteer screenshots guide for the current option details.

Rank #3
Sale
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • 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.

Wait until the page is ready to capture

The example uses waitUntil: 'networkidle2', a navigation wait condition demonstrated in Puppeteer’s screenshot guide. It is not proof that all application-specific content, animations, fonts, or lazy-loaded images have finished. Pages that update after navigation need a page-specific readiness check before you capture.

For example, if the page exposes a selector only after its main content is ready, wait for that selector after navigation:

Rank #4
Sale
Samsung Galaxy S26 Ultra, Unlocked Android Smartphone, 512GB, Black | Privacy Display, Galaxy AI, AI Camera, Super Fast Charging 3.0, Durable Battery, 2026, US 1 Year Warranty
  • 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
await page.goto('https://example.com', {waitUntil: 'networkidle2'});
await page.waitForSelector('.main-content');
await page.screenshot({path: 'ready.png'});

Choose a condition that reflects the target site’s actual rendering behavior. A selector is useful only if its presence means the content you need is ready; it does not automatically confirm that images or transitions have settled.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Compare emulated mobile screenshots consistently

When comparing devices, hold the page, capture timing, and screenshot extent constant. Record the selected preset and compare its viewport and user agent, since those are the device properties used by Puppeteer emulation. A changed viewport can alter responsive breakpoints and page layout, while a changed user agent can affect site behavior. Treat results as browser-emulation screenshots, not as proof of exact physical-device rendering.

Best Value
Tracfone Moto g Play 2024 Prepaid Phone with a 1-Yr Plan Included
  • 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

Troubleshoot common capture problems

  • The page looks like desktop. Apply page.emulate() before page.goto(), and confirm the chosen preset has the viewport and user agent appropriate to the test.
  • The screenshot is blank or incomplete. Navigation completion may not mean the application has rendered its target content. Wait for a meaningful selector or other page-specific readiness signal before capture.
  • A lazy-loaded image is missing. The page may not have loaded that image before the screenshot. Ensure the relevant content is brought into view or otherwise made ready, then capture; a generic network-idle event alone does not establish that every lazy resource is present.
  • An element screenshot throws an error. Confirm the selector matched an element and that the element remains attached to the document when screenshot() runs.
  • The output format is unexpected. Check the filename extension and any explicit screenshot type option. Puppeteer defaults to PNG and can infer a type from the extension.
  • The mobile layout differs from a real phone. Emulation sets browser device metrics and user agent; the cited API does not claim to reproduce every physical-device, operating-system, or browser-specific feature.

Or skip the browser setup

For a hosted screenshot API, ScreenshotNeo accepts one GET request for a URL and returns an image or PDF. For example, this saves a WebP screenshot of the target site; create an API key first and replace YOUR_API_KEY.

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 request options. ScreenshotNeo removes cookie/consent banners, newsletter popups, and chat widgets before capture, with each cleanup step configurable. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers identify the page verdict and billing status. It also offers an MCP server for AI agents, including Claude and Cursor, with screenshot, page-info, and PDF tools. The Free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. See ScreenshotNeo.

Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Does Puppeteer device emulation take a screenshot from a physical phone?

No. It applies browser user-agent and viewport settings to emulate a device; it is not a physical handset capture.

Can I use a different device preset?

Yes. Select another named entry from Puppeteer’s KnownDevices and pass it to page.emulate().

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.