Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk4 min

How to Screenshot a Website at Mobile Viewport Dimensions with Puppeteer

Set Puppeteer’s viewport before navigation to capture a website at mobile dimensions, or emulate a named device when its user agent and metrics matter.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To capture a website at mobile viewport dimensions with Puppeteer, set the page viewport before navigating, then save a screenshot with page.screenshot(). Use page.emulate() instead when you need a named device’s viewport metrics and user agent, not just a chosen width and height.

Set a mobile-sized viewport before loading the page

Choose the CSS-pixel width and height required by your task; there is no single dimension pair that represents every phone. This example uses 390 × 844 only as illustrative input values.

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.setViewport({
    width: 390,
    height: 844,
    deviceScaleFactor: 1,
  });

  await page.goto('https://example.com');
  await page.screenshot({path: 'mobile.png'});
} finally {
  await browser.close();
}
  1. Launch Puppeteer and create a page.
  2. Call page.setViewport() with the target width and height before navigation. The example also sets deviceScaleFactor to 1.
  3. Navigate to the target URL with page.goto().
  4. Capture the page with page.screenshot({path: 'mobile.png'}).
  5. Close the browser in a finally block so it is closed even if navigation or capture fails.

Puppeteer’s viewport guidance specifically recommends setting the viewport before navigating because some websites do not expect a phone-sized viewport to change after loading. See the Page.setViewport() documentation and the Puppeteer screenshot guide.

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

Choose dimensions or emulate a named device

Use viewport sizing when the output requirement is a width and height. Use device emulation when the page must also receive a particular device’s user agent and metrics. Puppeteer documents Page.emulate(device) as a shortcut combining Page.setUserAgent() and Page.setViewport().

#1 Best Overall
Sale
Smartphone Holder/Vertical and Horizontal Tripod Mount Adapter | Premium Rotatable Bracket, 1/4 in Screw, Adjustable Clip for iPhone, Android Cell Phone, Selfie Stick, Camera Stand
  • FEATURE: the tripod phone mount is adjustable by screw mechanism, 360 degree rotating, vertical(portrait mode) and horizontal(landscape mode) or any angle as you need, not necessary to take your cell phone out of a standard tripod or small tripod.
  • EASY TO USE: two options for using tripod phone holder: 1. screw it directly to the tripod or selfie stick with pivoting arm, being able to 360 degrees rotating, 2. remove the phone clamp from pivoting arm and then mount on a tripod or monopod.
  • ADJUSTABLE WIDTH: 2.2inch-4.1inch(55mm-105mm), attachable to any regular-size smartphone, tripod, selfie stick, monopod or camera; two standard 1/4 x 20mm female thread interfaces meeting your various needs. Very functional and compact.
  • MATERIAL: the black part made of sturdy plastic, the female threads inserted are brass, the male screw is steel and soft non-slipping silica gel pads, which protect your cellphone from scratch and hold the phone securely.
  • ATTACHABLE TO: most mobile phones, tripods, unipods, selfie sticks, cameras, camcorders, pico projectors, including iPhone 11/11 Pro/11 Pro Max/X/XS/XR/XS Max/8/7/6/6s Plus/SE/5s/5/5c, Samsung Galaxy S10/10+/S9/S9+/S8/S8+/S7/S6/S6 edge, Note10/10+/9/8 and Android phones.
Approach What to configure Use it when
page.setViewport() The requested viewport width and height; optionally a device scale factor. You need a specific layout size and do not require a device-specific user agent.
page.emulate(device) A Puppeteer device preset’s metrics and user agent. You are targeting a known device and want its emulated settings rather than dimensions alone.

For device emulation, choose a preset from Puppeteer’s KnownDevices collection and apply it before navigation:

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');
  await page.screenshot({path: 'device.png'});
} finally {
  await browser.close();
}

The device name above is an example of selecting a preset, not a claim that it is the right target for every test. Select the device that matches your intended browser or layout check. Puppeteer’s Page.emulate() documentation shows the device-emulation approach.

Rank #2
Syncwire Tripod Phone Mount, Universal Smartphone Mount Adapter | 2 Cold Shoe Mounts, 1/4"-20 Thread, 360° Rotation & 180° Tilt, Adjustable Cell Phone Clamp Holder, for Mobile Photography
  • Dual Cold Shoe Mounts: This phone tripod mount features 2 rotatable cold shoe mounts for attaching microphones, LED lights, and other accessories. Easily adjust accessory angles for photography, video recording, and vlogging.
  • Universal 1/4"-20 Thread: The smartphone tripod adapter features a standard 1/4"-20 threaded mount for compatibility with tripods, selfie sticks, monopods, cameras, stabilizers, and other compatible photography accessories.
  • 360° Rotation & 180° Tilt: Adjust your phone angle with 360° rotation and 180° tilt to switch easily between portrait and landscape orientations. The adjustable phone mount allows flexible positioning without an additional ball head.
  • Wide Phone Compatibility: This universal cell phone tripod mount fits smartphones measuring 2.16"–3.7" wide (5.5–9.4 cm), including iPhone 18 Pro Max and Samsung Galaxy S26 Ultra. For the best fit, avoid clamping directly over side buttons. With thick cases or protruding buttons, adjust the clamp position slightly higher or lower.
  • Secure, Non-Slip Grip: Thick, non-slip silicone pads help hold your smartphone securely and protect it from scratches. The adjustable phone clamp accommodates compatible devices with many types of phone cases for stable mounting during photos and videos.

Viewport screenshot or full-page capture?

Decide whether you need an image of the visible viewport or an image extending through the whole document. The examples above capture a page using Page.screenshot() without specifying a capture-extent option. Consult the current Page.screenshot() API documentation for the appropriate option when you specifically need a full-document image; do not assume a viewport-sized capture and a full-page capture are interchangeable.

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

Common problems and fixes

  • The page looks desktop-sized: Set the viewport before calling page.goto(). A site may choose its layout during initial loading.
  • The layout changes after setting mobile or touch properties: Puppeteer cautions that changing mobile or touch settings can reload a page in some cases. Configure the intended settings before navigation and avoid changing them mid-capture unless that reload is acceptable. See Page.setViewport().
  • The screenshot does not match a device-specific page: Viewport dimensions alone do not set a device user agent. Use page.emulate() with the intended preset before navigation if that device identity is part of the requirement.
  • The image has the wrong dimensions: Check the requested CSS-pixel width and height and the configured device scale factor. The illustrative 390 × 844 values are not a universal mobile specification.
  • You cannot tell what viewport Puppeteer has configured: page.viewport() reports Puppeteer’s viewport configuration; it is not an independent check of the actual rendered viewport. See the Page class documentation.
  • The output only shows the visible area: Confirm whether you need a viewport capture or a full-document capture, then consult the current screenshot API options for the latter.

Or skip the browser setup:

ScreenshotNeo returns a website screenshot or PDF from one GET request. Its screenshot API can capture a URL without you launching and configuring Puppeteer locally. Before capture, it accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with the outcome identified in response headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents using Claude, Cursor, or another MCP client. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. See ScreenshotNeo and its API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Rank #3
Sale
Metal Phone Tripod Mount 3 Cold Shoes & Arca Port, 360° Smartphone Tripod
  • 🏆【Latest Metal Phone Tripod Mount】: 360° rotation smartphone holder with 2 side cold shoe and 1 back cold shoe & 1/4" Expand Hole Design, you can attach additional LED light, microphone or other film device. It helps you film steady vlogging video for Facebook, Youtube, and platforms as well as live streaming channels.
  • 🏆【Back Cold Shoe & Two 1/4" Expand Hole Design】: There is a cold shoe on the back, which solves the problem that the wireless microphone cannot be fixed during mobile phone recording. Two 1/4" screw hole help you expand the devices you want.
  • 🏆【Standard Arca Mount on Bottom】- ULANZI Iron Man IV with a standard Aka quick release plate port, quick installation. A 1/4 screw port is added at the bottom to connect tripods. It is all aluminum metal made. Solid, Durable and Safer.
  • 🏆【Side Double Cold Shoe Design】: ULANZI ST-27 with 2 cold shoes on the side, you can mount your fill light & microphone at same time. It is be the best choice for your vlog.
  • 🏆【Extra Wide Compatibility】: Ulanzi phone tripod mount compatible with iPhone17 16 15 14 13 12/12Pro/12Pro Max/11/11Pro/11Pro Max/X/Xs/XR/Xs Max,8/7/6/6s, iPhone 6/6s plus, iphone SE,Samsung Galaxy s10s10 plus S9/S9+,S8/S8+/S7/S6/S6 edge, Note 10 9 8 5 4 3 and many other brands and models
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequently Asked Questions

Does a mobile viewport by itself make Puppeteer behave like a particular phone?

No. A width and height configure the viewport; use device emulation when you need a device preset’s user agent and metrics.

What does Puppeteer’s page.viewport() verify?

It reports the viewport configuration held by Puppeteer, not an independent measurement of the rendered page’s actual viewport.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
SMALLRIG Universal Phone Holder Mount with Cold Shoe - 4382
  • Universal Phone Holder: This multifunctional phone clamp can be mounted on the top of a camera or tripod through 1/4"-20 threaded hole or cold shoe at the bottom for photography, live-streaming, vlogging, interviews, etc
  • Support Landscape and Portrait Modes: The phone holder can be quick switching between landscape and portrait modes, and securely lock when rotated to 90° degrees. Two rotary joints supports 180 degrees adjustment
  • Universal Compatibility: It supports smartphones with a width of 57-88mm / 2.5-3.5in (for Samsung, for iPhone 18 / 18 Pro / 18 Pro Max / 17 /17 Pro/17 Pro Max/16/16 Pro/16 Pro Max/15/15 Pro /15 Pro Max / for iPhone 14/14 Pro /14 Pro Max / for iPhone 13 /13 Pro /13 Pro Max / for iPhone 12 Pro Max and so on)
  • Threaded Holes & Cold Shoe: Designed with well-spaced threaded holes to facilitate the installation of power bank holders (ID: 2336 / 2790). There is a cold shoe mount on top for microphone or light
  • Package Included: phone holder x 1. Please note that the load capacity is 500g
Rank #4
Sale
Liphisy 64” Tripod for Cell Phone & Camera with Remote and Phone Holder | Sturdy & Stable Height Adjustable Multi-Angle Shot Selfie Stick Tripod for Video Recording
  • 【Sturdy and Stable】: Made of premium aluminum alloy and stainless steel, Liphisy phone tripod with remote keeps your device stay securely in place for still shots and video recording.
  • 【Multi-angle Shot】: With a max height of 64”, this tripod stand with a 210-degree rotation head and 360-degree rotation holder allows you to capture shots from any angle, catering to different photography needs.
  • 【Wireless Remote Included】: Package includes a wireless remote that connects to your cell phone easily, making it a breeze to snap photos or video recordings.
  • 【Height Adjustable】: The height of this cell phone tripod with remote can be adjusted from 17” to 64” and the easy lock mechanism makes it really easy to set up. It gives you an excellent vantage point for capturing photos and videos.
  • 【Wide Application】: Compatable with different phone and camera, this tripod is great for photography and video recording, perfect for travel and home use.

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
Crashes, No Sound, or Screen Glitches?Free driver scan

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.