iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Use Playwright’s page.screenshot() after setting a repeatable browser context and waiting for the product content you need. For an English-language India-oriented rendering, configure the context with locale: 'en-IN' and timezoneId: 'Asia/Kolkata'; do not assume those settings alone select an Indian delivery address, currency, or merchant region.
Capture a product page with Playwright
Install Playwright, save this as an ES module such as screenshot.mjs, and replace the example URL and heading with values for the page you want to capture. The selector is illustrative, not verified for any particular retailer.
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');
await page.getByRole('heading', { name: /product name/i })
.waitFor({ state: 'visible' });
await page.screenshot({ path: 'product-page.png' });
} finally {
await browser.close();
}
The basic page.screenshot() call captures the current viewport and saves it to the path you specify. See the Playwright Screenshots guide and Page API for capture options. The code assumes Playwright is installed in your project and the target page is reachable.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Choose the capture area
Current viewport
The example captures what is visible in the 1365-by-900 viewport. Keep the viewport fixed when you need comparable screenshots; responsive layouts can change substantially at other dimensions.
#1 Best Overall
- [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)
Full scrollable page
Set fullPage: true to capture the full scrollable document:
await page.screenshot({ path: 'product-page-full.png', fullPage: true });
Full-page output can be much taller than a viewport image. Use it when the entire product listing or description matters; for a focused visual check, a viewport or element capture is usually easier to inspect.
One product component
Use a locator screenshot for a specific component, such as product details:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchawait page.locator('[data-testid="product-details"]')
.screenshot({ path: 'product-details.png' });
Replace the illustrative selector with one that exists on the retailer’s page. A locator screenshot of a scrollable element captures only the portion currently scrolled into view, rather than automatically capturing that element’s entire internal scroll area.
Set India-oriented browser context carefully
Playwright context settings can emulate viewport, locale, timezone, device parameters, and geolocation. For an English-language India-oriented browser presentation, en-IN and Asia/Kolkata are reasonable choices. Use a different locale when the intended page language is Hindi or another language.
Rank #2
- 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)
These settings change browser signals and rendering inputs; they do not guarantee that a merchant will show Indian inventory, prices, currency, taxes, or delivery availability. Retailers may instead use an account preference, a cookie, a postal code, or an on-page location selector. Confirm the actual page state before relying on the screenshot.
Geolocation, only when the page uses it
If the site requests browser location, set coordinates and grant the geolocation permission in the context. Choose coordinates for the test location rather than copying arbitrary values:
Free tools Windows power users keep installed
One-click scans. No signup required.
const context = await browser.newContext({
locale: 'en-IN',
timezoneId: 'Asia/Kolkata',
viewport: { width: 1365, height: 900 },
geolocation: { latitude: YOUR_LATITUDE, longitude: YOUR_LONGITUDE },
permissions: ['geolocation'],
});
Replace the coordinate identifiers with numeric values. If the retailer determines delivery from a postal code or account setting, browser geolocation may not change the displayed destination.
Wait for product content, not an assumed universal ready state
Wait for the element that matters to the image—for example, a product title or main image—and capture after it is visible. Do not use networkidle as a universal indication that an ecommerce page is ready: pages may keep making background requests, and Playwright discourages that load state for tests. See Playwright’s Page API for navigation and waiting behavior.
For a lazy-loaded image or section, scroll it into view and wait for its content before taking the screenshot. The correct locator and readiness condition depend on the site. For example:
Rank #3
- 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 productImage = page.locator('img.product-image');
await productImage.scrollIntoViewIfNeeded();
await productImage.waitFor({ state: 'visible' });
await page.screenshot({ path: 'product-image-area.png' });
Replace img.product-image with a selector matching the target page. Visibility alone does not prove an image has finished loading; where that matters, check the page-specific image state before capture.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesControl image format and visual variation
Playwright screenshot options support image format and other capture controls. For example, disable animations to reduce motion-related variation:
await page.screenshot({
path: 'product-page.png',
animations: 'disabled',
});
Use the path extension and screenshot options appropriate to the output you need; consult the Page API for supported format, quality, clipping, and animation behavior. A fixed viewport and consistent page state also make repeated captures easier to compare.
Make captures repeatable
When screenshots are used for visual comparison, record the inputs that can change the result:
- The exact URL and capture time.
- Browser engine and viewport dimensions.
- Locale, timezone, and any geolocation or delivery-location state.
- Whether the screenshot is viewport, full-page, or a locator capture.
- The selector or readiness condition used before capture.
Change one input at a time when diagnosing visual differences. A changed locale, location, viewport, or page state can each alter the resulting image.
Rank #4
- 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.
Troubleshooting common capture problems
The screenshot is blank or missing product details
Check that navigation reached the intended URL, then wait for a page-specific product element rather than capturing immediately. Verify that the locator matches the current page and that the retailer has not presented a sign-in, consent, or location-selection screen instead.
The wrong language, currency, or delivery region appears
Locale and timezone configure browser context signals, not a guaranteed merchant localization outcome. Inspect the retailer’s own location controls, account state, cookies, and postal-code selection; use geolocation only if the page actually relies on it.
A product image or lower section is absent
It may be lazy-loaded. Scroll the relevant content into view, wait for the page-specific image or section state, then capture. A full-page option changes the capture area but does not remove the need to ensure required content has loaded.
The page never appears ready
A persistent background request can make networkidle an unsuitable wait condition. Wait for the title, image, or other content that defines readiness for your task instead.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →An element screenshot is cropped unexpectedly
Confirm that the locator identifies the intended element and account for the fact that a scrollable element screenshot shows only the currently visible portion of its scroll area. Use a full-page screenshot if the entire document is required.
Best Value
- 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
Or skip the browser setup
ScreenshotNeo can return a website screenshot or PDF from one GET request. Its capture flow accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, with response headers indicating the page verdict and billing status. It also has an MCP server for AI agents, with tools including take_screenshot, get_page_info, and capture_pdf.
For an India-oriented capture, pass the relevant locale, timezone, viewport, and any supported location settings as query parameters. Verify merchant-specific delivery or currency state as you would with a browser-based capture. See the ScreenshotNeo documentation for API parameters and response details.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.in/product-page -o shot.webp
ScreenshotNeo’s Free plan includes 1,000 screenshots per 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.
Frequently Asked Questions
Can Playwright capture a PDF of a product page?
Yes. Playwright supports PDF output through its browser page PDF API; see the Page API documentation for details and browser limitations.
Does setting `locale: ‘en-IN’` force a retailer to show Indian prices?
No. Locale affects browser signals and presentation inputs, but a retailer may determine prices or delivery using account, cookie, postal-code, or on-page location settings.
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.

