Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon 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×
FREEDOM251

Freedom251 › Blog › browser automation

How to Capture a Playwright Screenshot of an Indian Ecommerce Product Page

By Freedom251 Team · · 5 min read

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

Use Playwright’s page.screenshot() after configuring a fixed viewport and India-oriented browser signals such as locale: 'en-IN' and timezoneId: 'Asia/Kolkata'. Wait for the product content you actually need to appear, then capture the viewport, full page, or a specific element. These settings influence browser rendering, but do not assume they set the store’s delivery location, currency, or account preferences.

Capture a product page with Playwright

Install Playwright in a Node.js project if it is not already installed:

As an Amazon Associate I earn from qualifying purchases.

npm install playwright
npx playwright install chromium

Save this as capture-product.mjs, replacing the example URL and product-name pattern with values for the page being captured:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import { chromium } from 'playwright';

const browser = await chromium.launch();
try {
  const context = await browser.newContext({
    viewport: { width: 1365, height: 900 },
    locale: 'en-IN',
    timezoneId: 'Asia/Kolkata',
  });
  const page = await context.newPage();

  await page.goto('https://example.in/product-page');
  // Replace this pattern with the product title shown on the target page.
  await page.getByRole('heading', { name: /product name/i }).waitFor({ state: 'visible' });
  await page.screenshot({ path: 'product-page.png' });
} finally {
  await browser.close();
}

Run it with node capture-product.mjs. The URL and title pattern are illustrative, not a verified retailer URL or selector. Playwright’s basic capture method is page.screenshot({ path: 'screenshot.png' }); see the Playwright Screenshots guide.

#1 Best Overall
Dell Optiplex 3060 Desktop Computer | Intel i5-8500 (3.2) | 32GB DDR4 RAM | 1TB SSD Solid State | Built in WiFi | Bluetooth | Windows 11 Professional | Home or Office PC (Renewed)
  • [INTEL POWERED CONTENT] - Built with a 8th Generation Hexa-Core Intel i5 and 32GB of DDR4 RAM; Modern, Windows 11 ready, with 4K support, Executive multitasking, media streaming and smooth, multi-tab web browsing; Perfect as an all-purpose multimedia computer; built for content creators; Plenty of RAM and Mass storage for photo and video editing powered by Intel HD 630
  • [LATEST WIRELESS TECH] - This Dell Desktop Computer easily connects to the internet through the Built In WiFi / Bluetooth
  • [SOLID STATE STORAGE] - This Dell Computer setup comes with an ultra-fast 1TB Solid State Drive (SSD); Setup as the primary boot device; Boot and load programs with lightning speed ; Additional expansion available
  • [BUY & OWN WITH CONFIDENCE] - From the world's largest Microsoft Authorized Refurbisher; Quality Guarantee and Free Tech Support; Award-winning Customer Service; | Support Sustainable Business
  • [MODERN HI-SPEED PORTS] - USB 3.0 (x4) | USB 2.0 (x4) | DisplayPort (x1) | HDMI Port (x1) | Audio Combo Jack (x1) | Audio Out (x1) | RJ-45 Ethernet (x1) | Internal SATA (x3)

Choose the capture area

Visible viewport

The basic page.screenshot() call captures the currently visible viewport. Use it when the image should show the product as a shopper initially sees it, or when you need consistent dimensions across runs.

Full scrollable page

Set fullPage: true to capture the full scrollable document:

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

A full-page image may be much taller than a viewport capture. Choose it when the listing, specifications, reviews, or other below-the-fold content matters.

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

One product component

Use a locator screenshot when you only need the product details or another specific component:

Rank #2
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
  • Model: Dell OptiPlex 7050 Small Form Factor (SFF)
  • Processor: Intel Core i7-7700 3.60 GHz
  • Memory: 32GB DDR4 Ram
  • Storage: 1TB Solid State Drive (SSD) Fast Boot + Storage
  • Operating System: Windows 11 Pro (64-bit)
await page.locator('[data-testid="product-details"]').screenshot({
  path: 'product-details.png',
});

The selector is an example; inspect the target page and choose a locator that identifies the intended element. A locator screenshot of a scrollable element captures only the portion currently scrolled into view. Playwright documents page and element capture options in its Page API and Locator API.

Set the browser context for an India-oriented page

Context options supply browser signals and rendering inputs. A fixed viewport makes repeated captures easier to compare. For an English-language India-oriented presentation, en-IN and Asia/Kolkata are reasonable values; use the locale matching the language you want to inspect.

const context = await browser.newContext({
  viewport: { width: 1365, height: 900 },
  locale: 'en-IN',
  timezoneId: 'Asia/Kolkata',
});

Playwright supports context emulation for viewport, locale, timezone, and device parameters. Consult the emulation guide for the available settings. A retailer may instead use a signed-in account, saved cookies, an explicit postal-code prompt, or its own location selector. Check the actual displayed price, currency, stock, language, and delivery estimate rather than treating locale or timezone as proof of localization.

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

Use geolocation only when the page uses it

If the target page requests browser location, set coordinates relevant to the scenario and grant the geolocation permission. Do not use arbitrary coordinates when location is not part of the test:

Rank #3
Sale
HP All-in-OneDesktop Computer, 16GB DDR5 RAM, Intel Quad-Cores, 128GB SSD, WiFi6, Keyboard & Mouse, Windows 11
  • IMMERSIVE 24 INCH DISPLAY: Experience stunning clarity on a Full HD IPS screen with ultra-thin bezels, offering a 90% screen-to-body ratio that makes everything from spreadsheets to streaming come alive with vibrant colors and crisp details.
  • POWERFUL INTEL PROCESSING: Tackle demanding tasks with ease thanks to the Intel processor and 16GB of high-speed memory, delivering smooth performance whether you're multitasking between applications or running productivity software.
  • GENEROUS STORAGE: Store all your important files, photos, and programs with blazing-fast solid state drive technology that ensures quick boot times, rapid file access, and plenty of space for your digital life.
  • ENHANCED PRIVACY AND COLLABORATION: Work confidently with the pop-up privacy camera that tucks away when not in use, plus dual microphones with noise reduction for crystal-clear video calls that keep you connected professionally.
  • ECO-CONSCIOUS DESIGN: Feel good about your purchase with an EPEAT Gold registered and ENERGY STAR certified computer that combines premium performance with responsible environmental manufacturing practices.
const context = await browser.newContext({
  viewport: { width: 1365, height: 900 },
  locale: 'en-IN',
  timezoneId: 'Asia/Kolkata',
  geolocation: { latitude: 19.0760, longitude: 72.8777 },
  permissions: ['geolocation'],
});

The coordinates above identify a Mumbai-area example; substitute the location relevant to your test. Geolocation helps only if the site uses the browser’s location API. The permissions and geolocation settings are documented in Playwright’s emulation documentation.

Wait for meaningful product content

A page navigation finishing does not guarantee that the product title or image is ready for a screenshot. Wait for a page-specific signal, such as the product title becoming visible, and add checks for other required content when necessary. Avoid using networkidle as a universal readiness condition: Playwright marks it as discouraged for tests and recommends assertions to determine readiness. See the Page API navigation notes.

For pages with lazy-loaded content, scroll the relevant section into view and wait for that content before capturing. The exact wait condition is site-dependent. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const reviews = page.locator('[data-testid="reviews"]');
await reviews.scrollIntoViewIfNeeded();
await reviews.waitFor({ state: 'visible' });
await page.screenshot({ path: 'reviews-view.png' });

For less visual variation between runs, keep viewport and context settings fixed. Playwright’s screenshot options include animation handling; use animations: 'disabled' when disabling animations suits the capture:

Rank #4
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
  • This Certified Refurbished product is tested and certified to look and work like new. The refurbishing process includes functionality testing, basic cleaning, inspection, and repackaging. The product ships with all relevant accessories, a minimum 90-day warranty, and may arrive in a generic box. Only select sellers who maintain a high-performance bar may offer Certified Refurbished products on Amazon.com.
  • Dell Optiplex 3050 SFF Desktop computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD
  • Includes: USB Keyboard & Mouse, USB WiFi adapter, Microsoft office 30 days free trail.
  • Port: Front: USB 3.0(2), USB 2.0(2); Rear: DP, HDMI, USB 3.0(2), USB 2.0(2), RJ-45.
  • Support 4K (3840x2160) Dual display, makes it easy to connect two monitors at the same time, and you can expand working Windows, mirror content, or expand a single window across multiple monitors.
await page.screenshot({
  path: 'product-page.png',
  animations: 'disabled',
});

Refer to the screenshot API options for supported output and capture controls.

Record settings when captures must be repeatable

When screenshots are used for visual review or comparison, record the inputs that can change what the image shows:

  • Target URL and capture time.
  • Browser engine and viewport dimensions.
  • Locale, timezone, and any device emulation.
  • Geolocation permission and coordinates, or the delivery-location state selected on the site.
  • Whether the capture is viewport, full-page, or element-only.
  • The locator or readiness condition used before capture.

When comparing two screenshots, hold these settings steady where possible. If several inputs change at once, it becomes harder to tell which one caused the visual difference.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common capture problems

The screenshot is blank or missing the product

Navigation may have completed before the product content loaded, or the locator may not match the page. Wait for a visible title or image that exists on the target page and verify the selector against the rendered DOM.

Best Value
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
  • Connectivity: Includes WiFi, Bluetooth, and LAN for wireless and wired connections
  • Memory: Features 16GB DDR4 RAM for smooth multitasking and performance
  • Storage: Combines 500GB SSD and 1TB HDD for ample storage space
  • Graphics: Integrated Intel UHD Graphics 630 for crisp visuals and video playback
  • Design: Sleek desktop tower with black color and slim profile for modern look

The page shows the wrong currency or delivery area

Locale and timezone are browser settings, not a guarantee of merchant localization. Check whether the retailer needs an account, cookie state, postal code, or location selection, then set that state through the site’s own supported flow.

A full-page image omits content that appears after scrolling

Some sections load only when brought into view. Scroll to the relevant section, wait for its content, and then capture; the page’s behavior determines the appropriate locator and wait condition.

An element screenshot cuts off a long component

A locator screenshot of a scrollable element captures its currently visible portion. Scroll within that element if needed, or capture the whole page with fullPage: true when the complete document is the desired output.

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

Screenshots differ between runs

Fix the viewport and context settings, use a meaningful content-based readiness check, and consider disabling animations. Also record any changing store state—such as selected location or account state—that can affect the rendered product page.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. A single request can return an image or PDF; its clean-shot options accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before capture, with each step optional. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf.

For a direct image request, use cURL (replace the target URL as needed; see the ScreenshotNeo API documentation):

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

The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for the free plan.

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

Quick Recap

Bestseller No. 2
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
Model: Dell OptiPlex 7050 Small Form Factor (SFF); Processor: Intel Core i7-7700 3.60 GHz; Memory: 32GB DDR4 Ram
$384.00
Bestseller No. 4
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
Includes: USB Keyboard & Mouse, USB WiFi adapter, Microsoft office 30 days free trail.; Port: Front: USB 3.0(2), USB 2.0(2); Rear: DP, HDMI, USB 3.0(2), USB 2.0(2), RJ-45.
$189.99
Bestseller No. 5
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
Connectivity: Includes WiFi, Bluetooth, and LAN for wireless and wired connections; Memory: Features 16GB DDR4 RAM for smooth multitasking and performance
$269.99

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.

browser automationecommerceIndiaPlaywrightweb screenshots

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.

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.