How to capture a Puppeteer screenshot of a Shopify store in India
Capture a Shopify storefront with Puppeteer, choose viewport or full-page output, and account for the store’s India market and language settings.
Use Puppeteer to open the Shopify storefront URL and save the rendered page with page.screenshot(). Set the viewport before navigation; use fullPage: true to capture the full scrollable page or omit it for just the visible screen. Puppeteer does not select India by itself: the store’s market and language settings, the URL, and visitor context affect what appears.
1. Install Puppeteer and capture a Shopify storefront
This runnable example uses Node.js with ES modules. Replace the example URL with the store’s public Online Store URL. Puppeteer’s screenshot guide documents the Page.screenshot() method and the basic navigation-and-save workflow. See the Puppeteer screenshots guide and Page.screenshot API.
npm install puppeteer
// screenshot-shopify.mjs
import puppeteer from 'puppeteer';
const storeUrl = process.argv[2] ?? 'https://your-store.example';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.setViewport({ width: 1365, height: 900 });
const response = await page.goto(storeUrl, {
waitUntil: 'networkidle2',
timeout: 60_000,
});
if (response && !response.ok()) {
throw new Error(`Navigation returned HTTP ${response.status()}`);
}
await page.screenshot({
path: 'shopify-store.png',
fullPage: true,
});
} finally {
await browser.close();
}
Run it with the store URL as an argument:
node screenshot-shopify.mjs https://your-store.example
The 1365 × 900 viewport is only an example. Choose dimensions that represent the screen you need to document or compare. Puppeteer’s viewport API controls the page’s viewport and can affect responsive layout; set it before navigating. See Page.setViewport.
2. Choose viewport, full page, or a selected region
By default, page.screenshot() captures the current viewport. Set fullPage: true for the full scrollable page. The screenshot API also supports clipping to a specific rectangle, saving to a path, and image type options. When type is inferred from the file extension, use an extension that matches the desired format. See the ScreenshotOptions reference.
| Need | Option | Example |
|---|---|---|
| Visible screen only | Default behavior | await page.screenshot({ path: 'screen.png' }) |
| Whole scrollable page | fullPage: true |
await page.screenshot({ path: 'full.png', fullPage: true }) |
| Specific rectangle | clip with x, y, width and height |
await page.screenshot({ path: 'region.png', clip: { x: 0, y: 0, width: 800, height: 500 } }) |
| JPEG output | type: 'jpeg' and optional quality |
await page.screenshot({ path: 'screen.jpg', type: 'jpeg', quality: 85 }) |
| PNG output | type: 'png' or a .png path |
await page.screenshot({ path: 'screen.png', type: 'png' }) |
Do not combine clip and fullPage unless the behavior is explicitly supported by the Puppeteer version you use; check the API reference for the installed version. A full-page capture can be much taller than the viewport, so check the image dimensions and file size before using it in a report or test baseline.
3. Capture the India-facing storefront
First decide what “India version” means for the capture: a particular market’s product availability and pricing, a language, or simply an India-facing URL. Use the intended storefront URL and verify the resulting page in the capture. A browser screenshot reflects what that browser session actually receives; the Puppeteer screenshot method itself does not choose a Shopify market or language.
Shopify documents that a store can redirect customers according to their location preferences when automatic redirection is enabled. It also documents browser-language redirection when a matching language is available. The result therefore depends on the individual store’s configuration and visitor context. See Shopify’s documentation on redirecting customers based on location and automatic language redirection.
- Use the store’s intended public URL, including any market-specific path or domain supplied by the store owner.
- Set the viewport to the desktop or mobile size you want to represent.
- Navigate with an authorized session if the storefront requires one; do not assume a particular network or geolocation setup is necessary or sufficient for a specific store.
- Inspect the resulting page for the expected market, currency, language, and content before treating the screenshot as an India-specific capture.
Shopify’s Storefront API has country and language context for API queries, but that is API behavior and does not by itself establish what a browser screenshot will show. If you need an exact market rendering, confirm the setup with the store owner and validate the browser result.
4. Capture a product page or another Shopify resource
For a product or content page, navigate to its public Online Store URL rather than assuming an admin or API resource URL is renderable. Shopify documents onlineStoreUrl as the URL for viewing a resource in the Online Store; it can be null when the resource is not published there. See the Shopify Product object reference.
If the resource is unpublished, unavailable in the selected market, or the URL is incorrect, the browser may show an error or a different page. Confirm publication to the Online Store and the correct market before debugging the screenshot code.
5. Wait for storefront content before saving
waitUntil: 'networkidle2' is a useful starting point for pages whose requests settle, but storefronts may keep connections active or load content after the initial navigation. Puppeteer supports navigation wait conditions such as load, domcontentloaded, networkidle0, and networkidle2; see Puppeteer lifecycle events.
If the page’s main content is tied to a known selector, wait for that selector explicitly:
await page.goto(storeUrl, { waitUntil: 'domcontentloaded', timeout: 60_000 });
await page.waitForSelector('main', { timeout: 30_000 });
await page.screenshot({ path: 'shopify-store.png', fullPage: true });
Replace main with a selector that exists on the target theme and page. For lazy-loaded images, a full-page screenshot does not guarantee that every image has loaded: inspect the result and use a page-specific wait or scrolling strategy if the theme loads content only as it approaches the viewport.
6. Troubleshoot common capture problems
| Symptom | Likely cause | Fix |
|---|---|---|
| Navigation times out | The page never reaches the selected idle condition, or the site responds slowly. | Try domcontentloaded followed by waitForSelector() for the page content you need. Raise the timeout only when the longer wait is appropriate. |
| Screenshot shows the wrong market or language | Shopify location or language redirects depend on store settings and visitor context. | Use the intended storefront URL, confirm the store’s market/language configuration, and inspect the rendered result. Do not assume Puppeteer selects India automatically. |
| Product URL shows an error or unexpected page | The resource may not be published to the Online Store, or the URL may be wrong. | Ask the store owner to confirm publication and use the resource’s public Online Store URL. |
| Page is blank or content is missing | Capture ran before the theme rendered its main content, or the page returned an error. | Check the navigation response, wait for a meaningful selector, and capture again after the content appears. |
| Images are missing in a full-page capture | Images may be lazy-loaded or delayed by the theme. | Wait for the relevant image elements or use a page-specific scroll-and-wait procedure, then inspect the output. |
| Output is unexpectedly cropped | The default capture is viewport-sized, or the clipping rectangle excludes content. | Use fullPage: true for the scrollable page, or adjust the clip coordinates and dimensions. |
| Browser process does not close after an error | Cleanup was skipped when navigation or capture threw. | Keep browser shutdown in a finally block, as in the example. |
7. Compare captures consistently
When making before-and-after screenshots or comparing stores, record the target URL, viewport width and height, full-page setting, and the visible market and language. Keep those inputs fixed across captures. A desktop viewport and a mobile viewport can trigger different responsive layouts, and a viewport screenshot is not directly comparable to a full-page capture.
For repeatable work, save screenshots with descriptive names and keep the capture settings alongside them. Do not treat an India-facing image as verified solely because the store is based in India; confirm the rendered market, language, and content.
8. Performance, reliability, and cost
A local Puppeteer capture requires a browser process and enough memory for the page and resulting image. Full-page screenshots can consume more time and memory than viewport captures, especially on very long pages. Use a fixed viewport, wait only for the content your task needs, close the browser in all cases, and avoid opening more browser pages or jobs concurrently than the machine can handle.
Reliability depends on both the browser workflow and the storefront: redirects, slow assets, page errors, consent flows, and theme-specific lazy loading can change the result. Record the URL and capture settings, check navigation status, and review the output when the screenshot is used as evidence or a regression baseline.
Puppeteer itself is software you run; compute and maintenance costs depend on where and how you run the browser. If you need a managed screenshot API instead of maintaining browser setup, see the option below.
9. Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF. Its capture flow accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the screenshot; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response includes page-verdict and billing headers. Its MCP server gives AI agents tools to take screenshots, get page information, and capture PDFs.
See the ScreenshotNeo API documentation for the available parameters. This cURL example saves a Shopify storefront capture:
curl -G "https://api.screenshotneo.com/v1/shot" \
-d access_key=YOUR_API_KEY \
--data-urlencode url=https://your-store.example \
-o shopify-store.webp
Equivalent Python:
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://your-store.example"},
timeout=90,
)
r.raise_for_status()
with open("shopify-store.webp", "wb") as f:
f.write(r.content)
Equivalent Node.js:
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://your-store.example',
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
const bytes = Buffer.from(await res.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('shopify-store.webp', bytes));
Cookie banners, popups, and chat widgets are removed before the shot. Bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for 1,000 free screenshots a month, with no card required.
10. FAQ
How do I take a full page screenshot with Puppeteer?
Navigate to the page, then call page.screenshot({ path: 'page.png', fullPage: true }). See the capture options above for output format and clipping.
How do I screenshot a Shopify store with Puppeteer?
Launch Puppeteer, create a page, set its viewport, navigate to the public storefront URL, wait for the page content, save with page.screenshot(), and close the browser in a finally block.
How can I see the India version of a Shopify store?
Use the intended India-facing storefront URL and confirm the store’s market and language settings. The rendered result depends on that store’s configuration and visitor context.
Does Puppeteer’s screenshot method set the Shopify market?
No. It captures what the browser rendered. Shopify’s redirects and storefront configuration determine the market or language that appears.


