Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesUse a Playwright device profile such as iPhone 13 to emulate an iPhone-sized browser context, then call page.screenshot(). The result is a browser-emulated screenshot, not a photo or capture from physical iPhone hardware. If you need only particular dimensions, set an explicit viewport instead.
Use an iPhone device profile
This runnable Node.js example uses Playwright’s Chromium browser and the iPhone 13 profile documented in Playwright’s device emulation guide. Device profiles include browser parameters such as viewport, screen size, user agent, and touch capability. Confirm that the named profile exists in the device registry for the Playwright version installed in your project.
As an Amazon Associate I earn from qualifying purchases.
-
Install Playwright if it is not already in the project:
npm install -D playwright.Recommended: Fix Windows Errors and Clear Junk Files in Minutes - Free Scan →Recommended: Crashes or Glitches? A Free Driver Scan Usually Finds the Culprit →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Save this as
mobile-shot.mjs:import { chromium, devices } from 'playwright'; const browser = await chromium.launch(); try { const context = await browser.newContext({ ...devices['iPhone 13'], }); const page = await context.newPage(); await page.goto('https://example.com', { waitUntil: 'load' }); await page.screenshot({ path: 'mobile-page.png' }); } finally { await browser.close(); } -
Run it with
node mobile-shot.mjs. Playwright writesmobile-page.pngin the current directory. Replace the example URL with the page you want to capture.#1 Best Overall
Apple iPhone 15 Pro, 128GB, Blue Titanium - Unlocked (Renewed)- 6.1inch Super Retina XDR display. ProMotion technology. Always-On display. Titanium with textured matte glass back. Action button
- Dynamic Island. A magical way to interact with iPhone. A17 Pro chip with 6-core GPU
- Pro camera system. 48MP Main | Ultra Wide| Telephoto. Super-high-resolution photos (24MP and 48MP). Next-generation portraits with Focus and Depth Control. Up to 10x optical zoom range
- Emergency SOS via satellite. Crash Detection. Roadside Assistance via satellite
- Up to 29 hours video playback. USB-C, Supports USB 3 for up to 20x faster transfers. Face ID
The default screenshot is the current viewport. The navigation waits for the page load event; sites that continue rendering content afterward may need an additional wait strategy, described below.
Choose a device profile or an exact viewport
Use a named profile when you want a coordinated set of emulated device settings, not just a width and height. Use an explicit viewport when exact dimensions are the only requirement. Playwright documents both context configuration and page-level viewport changes in its emulation guide.
| Method | Best suited to | What it configures |
|---|---|---|
| Named device profile | Emulating a device-style browser setup | A bundle of settings, including viewport, screen size, user agent, and touch capability |
| Explicit viewport | Controlling exact width and height | Viewport dimensions; it does not by itself supply the other profile settings |
To override a profile setting, put the explicit value after the profile spread; later object properties take precedence:
Recommended Free Tools
const context = await browser.newContext({
...devices['iPhone 13'],
viewport: { width: 390, height: 844 },
});
The dimensions above are an illustrative explicit viewport, not a claim that every iPhone has those dimensions. For viewport-only emulation, omit the device spread:
const context = await browser.newContext({
viewport: { width: 390, height: 844 },
});
You can also change a page’s viewport after creating it:
Rank #2
- 6.1inch Super Retina XDR display. ProMotion technology. Always-On display. Titanium with textured matte glass back. Action button
- Dynamic Island. A magical way to interact with iPhone. A17 Pro chip with 6-core GPU
- Pro camera system. 48MP Main | Ultra Wide| Telephoto. Super-high-resolution photos (24MP and 48MP). Next-generation portraits with Focus and Depth Control. Up to 10x optical zoom range
- Emergency SOS via satellite. Crash Detection. Roadside Assistance via satellite
- Up to 29 hours video playback. USB-C, Supports USB 3 for up to 20x faster transfers. Face ID
await page.setViewportSize({ width: 390, height: 844 });
That changes the viewport dimensions; it does not turn the context into a complete named device profile.
Capture the first screen or the whole page
page.screenshot() captures the visible viewport by default, which is usually the right choice for checking the initial mobile layout. Set fullPage: true to capture the full scrollable page, including content below the fold. The screenshot API documents these options and supported output formats in the page screenshot reference.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, 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 minuteawait page.screenshot({
path: 'mobile-page-full.png',
fullPage: true,
scale: 'css',
});
Full-page capture can produce a very tall image on long pages. Use viewport-only output when you need to review the first screen or keep the image to a predictable height.
Select image format and raster scale
Playwright supports PNG, JPEG, and WebP screenshots. The file extension can determine the output format; you can also specify type explicitly. Select the scale according to the image’s intended use:
| Scale | Output behavior | Useful when |
|---|---|---|
css |
One output pixel per CSS pixel | You want compact output dimensions aligned with CSS layout dimensions |
device |
Output uses device-pixel resolution and can be larger, especially for high-DPI settings | You need the emulated device-pixel resolution for downstream use |
For example, use a WebP filename and device scale for a viewport capture:
Rank #3
- 6.1" LTPO Super Retina XDR OLED, 120Hz, HDR10, Dolby Vision, 1179x2556px, 1000 nits (typ), 2000 nits (HBM), 19.5:9 ratio, 3274mAh Battery
- 256GB 8GB RAM, Apple A17 Pro (3 nm), Hexa-core (2x3.78 GHz + 4x2.11 GHz), Apple GPU (6-core graphics), iOS 17, upgradable to iOS 17.6.1, planned upgrade to iOS 18
- Rear camera: 48MP, f/1.8 (wide) + 12MP, f/2.8 (telephoto) 3x optical zoom + 12MP, f/2.2 (ultrawide), Front Camera: 12MP, f/1.9 (wide)
- 2G: 850/900/1800/1900, 3G: HSDPA 850/900/1700(AWS)/1900/2100, 4G LTE: 1/2/3/4/5/7/8/12/13/14/17/18/19/20/25/26/28/29/30/32/34/38/39/40/41/42/46/48/53/66/71, 5G: 1/2/3/5/7/8/12/14/20/25/26/28/29/30/38/40/41/48/53/66/70/71/77/78/79/258/260/261 SA/NSA/Sub6/mmWave - Dual eSIM
- Unlocked for freedom to choose your carrier. Compatible with both GSM & CDMA networks. The phone is unlocked to work with all GSM Carriers & CDMA Carriers Including AT&T, T-Mobile, Verizon, Sprint., Etc.
await page.screenshot({
path: 'mobile-page.webp',
scale: 'device',
});
To set a format independently of the filename, specify it directly, for example type: 'jpeg'. These format and scale choices change the output image, not the fact that rendering is emulated. See the screenshot API options for the supported parameters.
Use Playwright Test or codegen when they fit your workflow
Playwright Test projects
In Playwright Test, configure a project with a named device profile by spreading it into use:
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
projects: [
{
name: 'iPhone 13 emulation',
use: { ...devices['iPhone 13'] },
},
],
});
Alternatively, set a project viewport when dimensions alone are what matters. The same ordering rule applies: place explicit overrides after the spread.
Code generator
To launch Playwright’s code generator with a named profile, run npx playwright codegen --device="iPhone 13" https://example.com. For an explicit viewport rather than a named device, use --viewport-size="800,600"; that option specifies dimensions and is not a substitute for a device profile. See the codegen guide.
Make captures more reliable
A page’s load event does not guarantee that every image, animation, API-driven component, or lazy-loaded section has finished rendering. Choose a wait that matches the page rather than relying on an arbitrary delay for every site:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Rank #4
- 6.1" LTPO Super Retina XDR OLED, 120Hz, HDR10, Dolby Vision, 1179x2556px, 1000 nits (typ), 2000 nits (HBM), 19.5:9 ratio, 3274mAh Battery
- 256GB 8GB RAM, Apple A17 Pro (3 nm), Hexa-core (2x3.78 GHz + 4x2.11 GHz), Apple GPU (6-core graphics), iOS 17, upgradable to iOS 17.6.1, planned upgrade to iOS 18
- Rear camera: 48MP, f/1.8 (wide) + 12MP, f/2.8 (telephoto) 3x optical zoom + 12MP, f/2.2 (ultrawide), Front Camera: 12MP, f/1.9 (wide)
- 2G: 850/900/1800/1900, 3G: HSDPA 850/900/1700(AWS)/1900/2100, 4G LTE: 1/2/3/4/5/7/8/12/13/14/17/18/19/20/25/26/28/29/30/32/34/38/39/40/41/42/46/48/53/66/71, 5G: 1/2/3/5/7/8/12/14/20/25/26/28/29/30/38/40/41/48/53/66/70/71/77/78/79/258/260/261 SA/NSA/Sub6/mmWave - Dual eSIM
- Unlocked for freedom to choose your carrier. Compatible with both GSM & CDMA networks. The phone is unlocked to work with all GSM Carriers & CDMA Carriers Including AT&T, T-Mobile, Verizon, Sprint., Etc.
-
Wait for a meaningful element when the page has a clear completion signal:
await page.locator('main').waitFor({ state: 'visible' });. -
If content appears after a known interval, add a deliberate delay with
await page.waitForTimeout(1000); adjust it to the page, and avoid treating a fixed pause as proof that all content is ready. -
For content below the fold that loads on scroll, full-page capture may not cause every site’s lazy content to load. If missing content matters, scroll through the page before capturing or use a site-specific readiness condition.
Screenshot output can vary with the host operating system, browser version, settings, hardware, power source, and headless mode. For visual comparisons, create and update baselines in a consistent environment, and inspect a new baseline before accepting it. Playwright’s visual comparisons guide discusses these sources of rendering differences.
A one-off file capture and a visual regression assertion are different workflows. Use page.screenshot() to save an image directly. Use Playwright Test’s expect(page).toHaveScreenshot() when you want an assertion comparing a page against a screenshot baseline.
Best Value
- 6.1inch Super Retina XDR display. Aluminum with color-infused glass back. Ring/Silent switch
- Dynamic Island. A magical way to interact with iPhone. A16 Bionic chip with 5-core GPU
- Advanced dual-camera system. 48MP Main | Ultra Wide. Super-high-resolution photos (24MP and 48MP). Next-generation portraits with Focus and Depth Control. 4X optical zoom range
- Emergency SOS via satellite. Crash Detection. Roadside Assistance via satellite
- Up to 26 hours video playback. USB C, Supports USB 2. Face ID
Troubleshoot common problems
-
“Cannot read properties of undefined” for a device name: The installed Playwright version may not include that registry entry, or the name may be misspelled. Check the available device names for that installed version and use one of those, or configure an explicit viewport.
-
The capture has desktop dimensions: Check that the context was created with the device profile or viewport before the page was created. When overriding a profile, ensure the explicit
viewportappears after the spread. -
The image stops at the first screen: That is the default viewport capture. Set
fullPage: truewhen you need the scrollable page.Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
The image is unexpectedly large: Check whether
scale: 'device'is producing device-pixel output. Choosescale: 'css'for one output pixel per CSS pixel. -
Images or page content are missing: The page may still be rendering after navigation, or the content may be lazy-loaded. Wait for a relevant selector or condition; for below-the-fold content, scroll before capture if needed.
-
Visual snapshots differ between machines or runs: Rendering can depend on the browser and host environment. Keep the environment consistent and review changed baselines rather than assuming the page alone caused the difference.
Or skip the browser setup
For a screenshot without installing or configuring Playwright, ScreenshotNeo accepts a URL in one GET request and returns an image or PDF. For example, this cURL call saves a WebP screenshot:
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Quick Recap
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; bot checks, blank pages, and failed loads are not billed. It also has an MCP server for AI agents, and its Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Visit ScreenshotNeo for product details, or sign up free.
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.




