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
-
Install Node.js if it is not already available in your environment.
Recommended Free Tools
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
In your project directory, run
npm install playwright. -
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.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsChoose 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:
Rank #2
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.
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:
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →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
-
The browser does not launch: Install Chromium with
npx playwright install chromiumand confirm the Playwright package is installed in the project that runs the script.Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
The screenshot shows an error, password page, or unexpected region: Check what the storefront URL returns in the same environment. Access and regional states are store-specific; the capture API cannot establish which state is intended.
-
The page is still changing or loading: Inspect the page and decide what condition indicates that the content you need is ready before calling
page.screenshot(). A screenshot only records the rendered state at capture time. -
The full-page image is unwieldy: Use the default viewport capture, or capture a more specific element, rather than including the entire scrollable document.
-
Images differ between machines or runs: Keep the browser and execution environment consistent, and use animation disabling, masks, or a capture-time stylesheet for content that is expected to vary.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
The output looks softer or is much larger than expected: Check the selected image format and
scale. Device scaling can create higher-resolution, larger images; CSS scaling keeps one output pixel per CSS pixel.
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.
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.
Quick Recap
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.




