ScreenshotNeo

BlogHow-to

How to Inspect Elements on an iPhone

Use Safari Web Inspector on a Mac to inspect a live iPhone webpage, or use Shortcuts to query page elements without a computer.

By the ScreenshotNeo team4 October 20266 min read

To inspect the elements of a webpage open in iPhone Safari, use Safari Web Inspector on a Mac. Turn on Web Inspector in iPhone settings, connect the phone to the Mac, enable Safari’s developer features, then choose the iPhone’s open page from the Mac’s Develop menu. For limited page queries without a Mac, an iPhone Shortcut can run JavaScript on the active Safari webpage; it is not a full visual inspector.

How to use Safari Web Inspector with your iPhone

  1. On the iPhone, open Settings > Apps > Safari > Advanced and turn on Web Inspector. Settings labels can vary between iOS releases. Apple’s iOS inspection guide documents this setting.
  2. Connect the iPhone to your Mac with a data-capable cable. If the phone asks whether to trust the computer, tap Trust and enter the device passcode if prompted.
  3. On the Mac, open Safari and choose Safari > Settings > Advanced. Enable Show features for web developers. This exposes Safari’s developer tools and the Develop menu. See Apple’s instructions for enabling developer features.
  4. Open the page you want to inspect in Safari on the iPhone.
  5. On the Mac, choose Develop, select the connected iPhone, then select the page. Safari opens a Web Inspector window for that page.

In Web Inspector, use the Elements view to explore the page’s document structure and select nodes. You can inspect styles and other available page information in the inspector panels. The page itself remains open on the iPhone, so you can reproduce a real-device issue while examining it from the Mac.

Can I inspect an iPhone webpage wirelessly?

Yes, after the initial connection. Apple’s setup begins with Web Inspector enabled and the iPhone connected to the Mac by cable. Once the device is set up, open Safari’s Develop menu, open the device submenu, and choose Connect via Network. Apple also documents connecting through Xcode. Do not assume wireless inspection will work as a first-time, cable-free setup.

Can I use an iOS simulator?

Yes. A booted iOS or iPadOS simulator on the Mac can appear in Safari’s Develop menu, with Web Inspector enabled. A simulator is useful for development checks; use a physical iPhone when the issue depends on real-device layout, browser behavior, or hardware.

Can I inspect a webpage on my iPhone without a computer?

For selected data or simple page changes, use Apple Shortcuts’ Run JavaScript on Webpage action. It receives the active Safari webpage from the share sheet, so it can run JavaScript against the page’s document. This can help retrieve matching elements, but it does not provide the interactive visual DOM and style-inspection experience of Web Inspector on a Mac.

Build a simple element-count Shortcut

  1. In Shortcuts, create a new shortcut and add the Run JavaScript on Webpage action.
  2. Configure the shortcut to receive a webpage input from the share sheet if Shortcuts does not set that up automatically.
  3. Use the JavaScript below to count image elements. The action’s result is passed back through its completion handler.
  4. In Safari, open a page, tap Share, and run the shortcut.
const images = document.querySelectorAll("img");
completion(images.length);

To return a compact list of image URLs instead, use:

const imageUrls = Array.from(document.querySelectorAll("img"), image => image.src);
completion(imageUrls);

The action has an execution time limit. Call completion(...) with a result when the script is done; without it, Shortcuts cannot return the result as expected. Keep scripts small and return only the data you need. See Apple’s Shortcuts documentation for action setup and limitations.

Choose the right inspection route

Route Mac needed? Best for Limit
Safari Web Inspector with a physical iPhone Yes Interactive inspection of a live page on the device Initial setup uses a cable and requires enabling Web Inspector
Shortcuts JavaScript action No Querying or changing selected page data from Safari Requires a Shortcut and has execution limits; not a visual inspector
Safari Web Inspector with an iOS simulator Yes Development checks against a simulated device Does not reproduce every real-device condition

Or skip the browser setup

If you need a screenshot of a webpage rather than interactive DOM inspection, ScreenshotNeo is a website screenshot API and MCP server. Its API takes a URL and returns an image or PDF. It cannot replace Web Inspector for selecting and debugging live DOM elements, but it can capture a page without setting up a browser locally.

See the ScreenshotNeo API documentation. Example request:

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

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo removes supported cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000.

Sign up for 1,000 free screenshots a month, with no card required.

Troubleshooting

Symptom Likely cause Fix
The iPhone does not appear in Safari’s Develop menu Web Inspector is off, Safari’s developer features are disabled, the cable does not carry data, or the computer has not been trusted Check Web Inspector in iPhone Safari’s Advanced settings, enable Safari developer features on the Mac, reconnect with a data-capable cable, and accept the Trust prompt.
The iPhone appears, but the webpage does not The page is not currently open in Safari on the phone, or Safari has not refreshed its device listing Open the target page in iPhone Safari, then reopen the Develop menu and check the device submenu.
Web Inspector is missing on the Mac Safari’s web developer features are not enabled In Safari on the Mac, open Safari > Settings > Advanced and enable Show features for web developers.
The wireless device is unavailable Network inspection has not been enabled after initial wired setup, or the device and Mac are not reachable on the network Connect by cable first, then choose Connect via Network in the Develop device submenu. Reconnect the cable if needed.
A Shortcut returns no result or stops The script did not call the completion handler, took too long, or returned more data than needed Call completion(result), reduce the work and output, and run it again from the active webpage’s share sheet.

Performance, reliability, and practical limits

  • For reliable device discovery: use the cable-based setup first, accept the trust prompt, and keep the target page open in Safari on the iPhone.
  • For repeat inspection: enable network connection after the wired setup if you want to inspect without keeping the cable attached.
  • For real-device bugs: use a physical phone. Simulator inspection is convenient, but it is a simulated environment.
  • For quick data extraction: Shortcuts can return narrowly scoped results such as matching elements or their attributes. Keep the script and returned data small because the action has a time limit.
  • Cost: the documented workflows use Safari and Shortcuts; the research sources identify no required paid tool. A cable may already be available, and connector compatibility depends on the ports on both devices.

FAQ

Where is Web Inspector in iPhone settings?

Open Settings > Apps > Safari > Advanced and enable Web Inspector.

Does iPhone Safari have an Inspect Element menu?

The supported full inspection workflow is opened from Safari’s Develop menu on a Mac after connecting the iPhone. Ordinary browsing in iPhone Safari is separate from the Mac’s Web Inspector.

Do I need to buy a cable?

Only if you do not already have a compatible data-capable cable. The connector depends on the ports on your iPhone and Mac.

Can Shortcuts show CSS styles visually?

Shortcuts can run JavaScript to query or modify selected page content, but it is not the full interactive visual inspector. Use Safari Web Inspector on a Mac for that workflow.