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 desk6 min

How to Capture Mobile Websites with Selenium WebDriver

Use ChromeDriver mobile emulation and Selenium’s screenshot API for repeatable mobile viewport captures, with guidance on profiles, waits, limitations, and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To capture a mobile website with Selenium, start ChromeDriver with Chrome’s mobileEmulation option, open the page, wait for the content you need, and save a WebDriver screenshot. Choose a ChromeDriver-recognized device profile or set the viewport metrics yourself. This is useful for repeatable responsive-layout checks, but it does not reproduce every behavior of a real phone.

Choose a mobile emulation profile

ChromeDriver supports two ways to configure mobile emulation. Configure it before creating the WebDriver session.

Approach When it fits Trade-off
Predefined device name You want a quick setup using a profile ChromeDriver recognizes. The available names vary with the Chrome and ChromeDriver versions. An unknown name can produce an invalid-device error.
Custom device metrics You need a precise viewport or a profile not available by name. You must choose and record the metrics and any additional mobile behavior you need.

ChromeDriver’s guide documents screen width, height, and pixelRatio for custom metrics. It also covers mobile and touch behavior, and optional clientHints and userAgent values. Client hints can affect platform identification and whether a site requests mobile or desktop resources. See the ChromeDriver mobile emulation guide for the supported configuration and version-specific device list.

Do not assume a legacy user-agent string is enough to establish client hints: ChromeDriver warns that inferring hints from that string is unreliable because its format is ambiguous. Use the API for the Selenium binding and release in your project; method names and signatures differ between bindings. The Selenium JavaScript Chromium options reference describes setMobileEmulation with either a device name or custom metrics, and says passing null disables emulation: Selenium Chromium Options API.

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.
#1 Best Overall
Yojaro 4Pack Silicone Suction Phone Case Mount, Silicon Adhesive Smartphones Stand Sticky, Hands-Free Phone Accessories Holder for Selfies and Videos (Black & White & Translucent & Light Pink)
  • 【Strong Adsorption】The inspiration of the silicone phone suction case comes from the adhesive force of the octopus. Each suction cup phone mount is 3.15 inches long and 2.17 inches wide, with 24 independent suction cups providing a stronger and more stable suction force, so you don't have to worry about your phone falling during use.
  • 【Back of Phone Suction Grip】Remove the adhesive film on the phone suction cup and stick it on the phone case. You can then fix the phone on any smooth surface, which is very convenient. (The phone suction cup cannot be removed and reused after being attached to the phone case. It is recommended to attach it to a regular phone case, not a valuable one.)
  • 【Widely Used】Our non-slip silicone phone sticky grip mount attaches to almost any flat phone case and make it compatible with common mobile phones such as iPhone and Android.You can shoot, watch videos or video calls in the kitchen, gym, dance studio, bathroom and other places.
  • 【Capture the Wonderful Picture】Whether you are a TikTok creator or just like to share videos and photos, this phone suction cup can help you hands-free capture wonderful videos and photos for sharing with friends.
  • 【Note】You can fix the phone suction cup on a smooth surface such as a mirror or glass. If necessary, wipe the suction cup with a damp cloth to obtain stronger suction. Before releasing your hand, make sure the phone is firmly fixed. (Not applicable to rough walls, wooden surfaces, and other uneven surfaces)

Capture a mobile screenshot with Selenium in Python

This runnable example uses a custom viewport so it does not depend on a named device being present in the active ChromeDriver device list. Install Selenium with python -m pip install selenium and ensure a compatible Chrome browser and ChromeDriver are available. Replace the URL and viewport values with the ones you intend to test.

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait

url = "https://example.com"

options = Options()
options.add_experimental_option(
    "mobileEmulation",
    {
        "deviceMetrics": {
            "width": 390,
            "height": 844,
            "pixelRatio": 3.0,
        },
        "mobile": True,
        "touch": True,
    },
)

# Selenium Manager or your environment must be able to locate a compatible
# ChromeDriver installation.
driver = webdriver.Chrome(options=options)
try:
    driver.get(url)

    # Prefer a page-specific readiness condition where possible. This example
    # waits for document readiness, not for every client-rendered component.
    WebDriverWait(driver, 20).until(
        lambda d: d.execute_script("return document.readyState") == "complete"
    )

    driver.save_screenshot("mobile-viewport.png")
finally:
    driver.quit()

The example saves a screenshot through Selenium’s WebDriver API. Screenshot behavior, especially full-page capture, can vary by binding and driver; check the documentation for the binding version you use before treating its output as a full-page image. For a page-specific test, replace the generic readiness condition with a wait for the selector or state that proves the content under test is present.

Rank #2
Apple EarPods Headphones with USB-C Plug, Wired Ear Buds with Built-in Remote to Control Music, Phone Calls, and Volume
  • SUPERIOR COMFORT — Unlike traditional circular ear buds, the design of EarPods is defined by the geometry of the ear. Which makes them more comfortable for more people than any other ear bud–style headphones.
  • HIGH-QUALITY AUDIO — The speakers inside EarPods have been engineered to maximize sound output and minimize sound loss, which means you get high-quality audio.
  • BUILT-IN REMOTE — EarPods with USB-C plug also include a built-in remote that lets you adjust the volume, control the playback of music and video, and answer or end calls with a pinch of the cord.
  • COMPATIBILITY — Works with all devices that have a USB-C port.
  • INTEGRATED MICROPHONE — A built-in microphone precisely captures your voice while you’re on the phone, taking a FaceTime call, or summoning Siri — so you’re always heard loud and clear.

Use a recognized device profile instead

If you want ChromeDriver’s predefined profile, replace the custom add_experimental_option call with the device name supported by your installed ChromeDriver/Chrome combination:

options.add_experimental_option(
    "mobileEmulation",
    {"deviceName": "<recognized-device-name>"},
)

Use a name from the device list for the version you run; do not copy a profile name from a different installation without checking it. If configuration fails with an invalid device name, switch to custom metrics or use a recognized name.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
PopSockets Adhesive Phone Grip, Holder- Black
  • Secure Hold: Our PopSockets adhesive phone grip gives your cell phone a secure, comfortable hold in hand to help prevent drops while texting, taking photos, or scrolling on the go. Designed to stick firmly to most phone cases and devices.
  • Hands-Free Made Easy: Easily turn your PopSocket into a phone stand to prop up your phone anywhere, perfect for watching videos, video calls, or following recipes. A must-have phone holder that keeps your device secure and ready for anything.
  • Compatibility: Works with all phones, tablets, and Kindles. Sticks best to smooth, hard plastic cases and may not adhere to silicone or textured cases. Easily swap your PopTop to change up your style.
  • Black PopSockets: Simple, refined, and endlessly versatile. A timeless essential for any phone.
  • Travel Must-Have for People On the Go: A must-have travel accessory for flights, flying, airports, air travel, airplanes, planes, international trips, cruises, and long travel days. Key gadget for your airport haul, travel accessories and must-haves.

Make the capture repeatable

  1. Choose and record the profile. Note the device name or the width, height, pixel ratio, and any mobile or touch settings. Record relevant client hints or user-agent configuration too.
  2. Configure before starting ChromeDriver. Add the mobile-emulation capability to Chrome options before creating the driver session.
  3. Navigate and wait for the state you need. A generic page-load event may occur before a client-rendered component appears. Wait for a page-specific selector, text, or other reliable condition.
  4. Save the screenshot and its test context. Alongside the image, record the browser, ChromeDriver, Selenium binding and version, viewport settings, target URL, and relevant page state.
  5. Use a physical device when the test depends on hardware. Emulation does not establish how every real phone will render or behave.

Selenium’s binding-level screenshot API is the straightforward capture path. For Chrome-specific lower-level control, the Chrome DevTools Protocol Page domain documents Page.captureScreenshot, as well as commands to override and clear device metrics. Its tot documentation is live, so verify the protocol available to the Chrome version you use: Chrome DevTools Protocol Page domain.

Understand what emulation can and cannot test

ChromeDriver describes desktop mobile emulation as useful but not a perfect substitute for testing on a device. It identifies differences that include mobile GPU behavior, mobile browser UI and its effect on page height, disambiguation popups for nearby touch targets, and hardware APIs such as some orientation events. Emulation is appropriate for repeatable responsive-layout checks and screenshot automation; validate on actual hardware when those device characteristics matter.

Rank #4
360° Rotating Stainless Steel Phone Tether Tab (Silvery 3-Pack) - Universal for iPhone & Other Phones (Fits Wristbands/Necklaces/Crossbody Straps)
  • [360 ° Flexible Rotation Design] Comes with a rotatable lanyard ring that supports 360 ° free rotation, effectively solving the problem of twisted and tangled lanyards
  • [Wide compatibility] The ultra-thin 0.02-inch design does not block the charging port at all, and both wired and wireless charging can be used directly without removing the pad. Compatible with most smartphones such as iPhone, compatible with various wristbands, lanyards, crossbody straps, and keychains
  • [Durable and Portable Material] Premium rust-resistant stainless steel material with good flexibility, which not only avoids scratching the phone case, but also has excellent anti rust and anti fading performance
  • [Multi scenario Practical] Paired with a lanyard or wristband, hands-free use can be achieved. The phone is within reach and not easily dropped, ideal for daily commuting and outdoor activities. Suitable for full coverage phone cases, does not support half coverage phone cases
  • [Quality Service] If you find any damage or other issues with the product upon receipt, please contact us immediately. We will handle it quickly

Setting a viewport does not make a desktop browser identical to a phone, and a screenshot at one size cannot prove that a site works across devices. Selenium describes WebDriver BiDi as its standards-based direction for bidirectional browser communication, while noting that its CDP functionality is limited and temporary as BiDi support is implemented. The mobile emulation and screenshot operations described here are documented through ChromeDriver and CDP; do not assume every binding offers portable BiDi equivalents for these exact commands. See Selenium WebDriver BiDi.

Troubleshoot common problems

  • Invalid device name: The selected name is not recognized by the active ChromeDriver/Chrome device list. Check the list for that version or change to custom device metrics.
  • The page looks desktop-sized: Confirm mobileEmulation was set on Chrome options before the driver session started. Check the configured width and height, and whether the profile’s mobile behavior and client hints fit the site’s responsive logic.
  • Expected content is missing from the image: The page may not have finished rendering that content when the screenshot was taken. Wait for a specific selector or application state rather than relying only on a generic page-load event.
  • The screenshot is only the visible viewport: Check the screenshot semantics supported by your Selenium binding and driver. Do not assume the WebDriver screenshot API produces a full-page capture; use a documented Chrome-specific approach if you need lower-level control.
  • The screenshot differs from a phone: Check whether the difference involves browser UI, touch behavior, GPU rendering, or a hardware API. Those are reasons to validate on a physical device, not necessarily signs that the viewport configuration failed.
  • Results change between runs: Keep browser, ChromeDriver, Selenium version, profile metrics, target page state, and wait condition consistent, and include them with the saved artifact.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server. A single GET request can return a screenshot or PDF; for this example, the API returns a WebP screenshot. It is an alternative when you want a screenshot without managing a Selenium browser session, but it is not a substitute for testing behavior that requires a real phone.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anteel 2 Pack Silicone Suction Cup Phone Case Mount Double Sided, Hands-Free Silicon Phone Grip with Higher Suction Power for Selfies and Videos, Non Slip Phone Accessories (LightPink&White)
  • 【PKYAA Double Sided Silicone Suction Phone Case Mount】PKYAA With Double Sided 40 Strong and Reliable individual suction cups, PKYAA provides a thicken and upgraded universal silicon suction mount for your phone.
  • 【Friendly to Content Creators】If you are a content creator or an online influencer, you can create videos anywhere with this suction mount completely hands free with this silicone cell phone mount for cases.
  • 【HANDS-FREE & Adhere to Mirrors】This Double Sided silicone suction phone case mount allows you to stick your phone to the mirror easily. No longer holding your phone in one hand to watch video tutorials while making up.
  • 【Strong Grip on the Smooth Surface】You can easily hang your phone anywhere with a smooth surface. All you do is you clean off your phone and smooth surface. It is STURDY and it not only sticks to mirrors, it also sticks to windows, it sticks to refrigerators, tiles and other clean, flat surfaces.
  • 【Press Down Firmly Every 30 Minutes】Use your palm or fingers to press the phone down firmly and check it's secure before letting go. Apply even pressure for a few seconds to allow the suction cup to adhere properly. To maintain the grip and prevent accidental falls, it's a good practice to periodically reapply pressure to the suction cup.

Install the Python dependency with python -m pip install requests, then use this example with your API key and target URL. See the ScreenshotNeo API documentation for request options.

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
  • Cookie banners are accepted before capture; 60+ known consent platforms, newsletter popups, and chat widgets are removed. Each step can be turned off.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers report the page verdict and billing status.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents, including Claude, Cursor, and other MCP clients.
  • The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo and get 1,000 free screenshots a month with no card.

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. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
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.