Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

How to Capture Screenshots of a Shopify Storefront with Playwright

A practical Playwright guide to capturing a Shopify storefront, from a basic viewport PNG to full-page images and more stable visual comparisons.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Playwright’s page.screenshot() after navigating to the storefront URL. By default it saves the visible viewport; set fullPage: true to include the scrollable page. The example below saves a storefront screenshot as a PNG.

Capture a Shopify storefront with Playwright

Install Playwright, then launch a browser, open a page, navigate to the storefront, and call page.screenshot() with a file path. Replace the example URL with a storefront you are authorized to access.

As an Amazon Associate I earn from qualifying purchases.

Install Playwright

  1. Install Node.js if it is not already available in your environment.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  2. In your project directory, run npm install playwright.

  3. Install the browser binaries with npx playwright install chromium.

Save a viewport screenshot

Save this as capture.js, replace the URL, and run node capture.js:

const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  try {
    const context = await browser.newContext();
    const page = await context.newPage();

    await page.goto('https://your-storefront.example');
    await page.screenshot({ path: 'storefront.png' });
  } finally {
    await browser.close();
  }
})();

The output file, storefront.png, contains the current viewport. Playwright’s Page screenshot API documents the capture options.

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

Choose viewport or full-page capture

Capture only the visible screen

The default screenshot is the page’s current viewport. Use this for a storefront’s first visible screen or when you want captures to have consistent dimensions.

Capture the whole scrollable page

Set fullPage: true to capture beyond the initial viewport:

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

A full-page image can be very tall. If you need only a product section or another specific portion, consider targeting an element rather than saving the entire page.

Choose image format and scale

Playwright supports PNG, JPEG, and WebP output. The format can be selected with the type option; JPEG and WebP can also use a quality value. PNG is useful when you want lossless output, while JPEG or WebP can reduce file size at the cost of some image detail.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.screenshot({ path: 'storefront.webp', type: 'webp', quality: 85 });

Use scale: 'css' for one output pixel per CSS pixel. Use scale: 'device' to capture at device-pixel resolution, which can provide more detail and create larger files. For example:

await page.screenshot({
  path: 'storefront-retina.png',
  scale: 'device'
});

Make captures easier to read and compare

Reduce animation-related variation

Animations can change what appears in a capture. Set animations: 'disabled' to disable or fast-forward supported animations during the screenshot:

await page.screenshot({
  path: 'storefront-still.png',
  animations: 'disabled'
});

Mask changing content

Use mask to cover selected locators with a solid color when their contents change between runs. This is useful for variable elements such as a timestamp or rotating content; it does not make the rest of the page identical.

await page.screenshot({
  path: 'storefront-masked.png',
  mask: [page.locator('.changing-content')]
});

Apply a temporary stylesheet

The style option applies CSS while the screenshot is taken. For example, hide an element that is irrelevant to the capture:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.screenshot({
  path: 'storefront-clean.png',
  style: '.temporary-overlay { visibility: hidden !important; }'
});

These options help control specific sources of visual variation, but they do not guarantee identical images across runs. Playwright notes that rendered screenshots can vary with the host operating system, browser version, settings, hardware, power source, headless mode, and other factors. For visual regression comparisons, generate and compare captures in a consistent environment. Its screenshot assertions wait for consecutive screenshots to match before comparing them with the expected image; see the visual comparisons guidance.

Handle storefront access and loading carefully

A Shopify storefront may show different content depending on its access requirements or visitor context. The available evidence does not establish a universal behavior for password pages, consent dialogs, authentication, or regional storefront states, so inspect the page you actually receive rather than assuming a particular Shopify-specific flow.

If the capture is blank or incomplete, first check the resulting page in a browser and confirm that the URL is accessible from the environment running Playwright. Then consider whether the page needs more time or a particular visitor state before capture. Do not treat a successful screenshot call as proof that the intended storefront content loaded.

Troubleshoot common capture problems

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 can return a storefront screenshot from one GET request. Its consent handling accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. An MCP server provides screenshot tools for AI agents, and the Free plan includes 1,000 screenshots per month without a card.

Example cURL request (replace the URL and supply your API key); see the ScreenshotNeo documentation for options:

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

ScreenshotNeo also supports Playwright-style screenshot options, including full-page capture. Paid plans start at $5 for 3,000 shots. Learn more at ScreenshotNeo, or sign up for 1,000 free screenshots a month with no card.

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.

Frequently Asked Questions

Does fullPage: true capture the entire Shopify store?

No. It captures the full scrollable page currently open, not every page in the store.

Can Playwright make screenshots pixel-identical on every computer?

No. Browser and machine differences can affect rendering; use the same environment for visual baselines.

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
PC Slower Than It Used to Be?Free scan - under a minute
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.