ScreenshotNeo

BlogAI agents

How to Make an AI Agent Screenshot a Webpage with Indian Date and Currency Formats

Set an AI agent’s browser to India’s locale and timezone, verify how the page formats dates and INR, then capture the rendered result with Playwright.

By the ScreenshotNeo team4 October 20268 min read

To make an AI agent screenshot a webpage with India-appropriate dates and rupee amounts, set the browser context locale to en-IN and timezone to Asia/Kolkata before navigating. Then wait for the page to render, inspect the visible date and price text, and capture the screenshot. These settings influence browser locale behavior and local time; they do not rewrite hardcoded or server-rendered strings. If you control the page, format values explicitly with JavaScript Intl.DateTimeFormat and Intl.NumberFormat.

The examples below use Playwright with Node.js. Set the locale and timezone in the browser context, not after the page has loaded. Playwright documents these emulation controls in its locale and timezone guide. A screenshot records the rendered page state; it does not translate or localize content for you.

1. Choose the intended language, date, and time behavior

“Indian format” can mean different things. Decide what the person viewing the screenshot should see before configuring the agent.

  • Language and regional conventions: Use en-IN for English-language India conventions. Use hi-IN if Hindi locale behavior is intended. The locale can affect locale-sensitive formatting, but the target site must use browser or application locale information for the change to be visible.
  • Timezone: Use Asia/Kolkata when timestamps should display in India local time. Timezone affects how an instant maps to a local clock time; it is not automatically appropriate for date-only values such as a birthday or invoice date.
  • Date layout: Specify the desired date order and detail where the application lets you control formatting. Do not assume every browser or runtime will produce exactly the same punctuation, digits, or month style for a locale.
  • Currency: Use the currency code INR for rupee amounts. A locale setting alone does not convert a USD amount into INR or change the underlying value.

For a site you do not control, configure the browser and then inspect what the site actually renders. For a site you do control, make the formatting requirements explicit in its code.

2. Set up a Playwright browser context and capture the page

This runnable example creates an India-localized Chromium context, navigates to a URL supplied on the command line, waits for the page load event, and saves a full-page PNG. It also prints the page title and visible body text so you can check whether dates and prices appeared as expected. Install Playwright and its Chromium browser first using the commands in the official Playwright getting started guide.

import { chromium } from 'playwright';

const url = process.argv[2];
if (!url) {
  throw new Error('Usage: node screenshot-india.mjs https://example.com');
}

const browser = await chromium.launch({ headless: true });
try {
  const context = await browser.newContext({
    locale: 'en-IN',
    timezoneId: 'Asia/Kolkata',
    viewport: { width: 1440, height: 1000 },
    deviceScaleFactor: 1,
  });

  const page = await context.newPage();
  await page.goto(url, { waitUntil: 'load', timeout: 60000 });

  // Prefer a page-specific readiness signal when one is available.
  // For example: await page.locator('[data-page-ready="true"]').waitFor();
  const visibleText = await page.locator('body').innerText();
  console.log('Title:', await page.title());
  console.log('Visible page text:\n' + visibleText);

  await page.screenshot({ path: 'india-localized.png', fullPage: true });
  await context.close();
} finally {
  await browser.close();
}

Save it as screenshot-india.mjs and run node screenshot-india.mjs https://example.com. This captures whatever the target page rendered. The text inspection is a useful check, but it does not prove every value is correctly localized: inspect the relevant dates and amounts or assert the exact expected text for a page you control.

Playwright also supports viewport and full-page screenshots, element screenshots, output types, and scale choices. See the official Page API for screenshot options. For an AI agent using a different framework, apply the same sequence: create or configure the browser session with locale and timezone, navigate, wait for the relevant content, inspect it, then capture.

3. Format dates and INR explicitly when you control the page

Browser emulation cannot change a string that application code has already hardcoded, nor can it force a third-party server to return a different representation. Use locale-aware formatters in the page when you own its rendering logic. MDN documents Intl.DateTimeFormat and Intl.NumberFormat.

const date = new Date('2026-10-04T12:00:00Z');
const amount = 123456.78;

const dateText = new Intl.DateTimeFormat('en-IN', {
  timeZone: 'Asia/Kolkata',
  day: '2-digit',
  month: '2-digit',
  year: 'numeric',
}).format(date);

const priceText = new Intl.NumberFormat('en-IN', {
  style: 'currency',
  currency: 'INR',
}).format(amount);

console.log(dateText);
console.log(priceText);

Formatting output can differ in date order, digits, symbol placement, spacing, and grouping depending on locale and runtime data. Check the actual browser output against the format your audience expects. For data with business-specific rules, define those rules directly and test them rather than relying on an unstated default.

4. Give the agent a reproducible capture workflow

  1. Specify the audience and format. Tell the agent whether to use English or Hindi, the desired date presentation, INR, and whether timestamps should show India local time.
  2. Start a fresh context when possible. Configure locale and timezoneId before opening the target page. An existing session may have settings the agent cannot change.
  3. Navigate and wait for a meaningful signal. Wait for a selector, application-ready marker, or other page-specific signal when available. A fixed short delay can capture a page before its content or formatting updates.
  4. Inspect the rendered values. Read the visible date and amount from the DOM or accessibility information. If the expected formatting is absent, determine whether the page ignores browser locale or uses server-provided strings.
  5. Capture the needed scope. Use a viewport shot for the initial screen, a full-page capture for content below the fold, or an element capture when only a particular panel matters.
  6. Record the settings. Include the locale, timezone, screenshot scope, viewport, and any mismatch in the agent’s result so another person can reproduce it.

Full-page capture may cause lazy-loaded images or content to load as the page is scrolled, depending on the capture method. Check the resulting image for missing sections. Increasing device scale can make text sharper, but it also increases output pixel dimensions and file size. Playwright MCP describes viewport, element, and full-page screenshot choices in its screenshot tools documentation.

5. Common problems and fixes

Symptom Likely cause Fix
Date remains in a US-style layout The page uses a hardcoded string, server-rendered value, or formatter with a fixed locale. Inspect the rendered text. If you control the page, use Intl.DateTimeFormat('en-IN', ...). For a third-party site, report the actual output instead of claiming the browser setting overrode it.
Time is wrong even though the date looks localized Locale and timezone are separate. The browser may still use another timezone, or the source value may be date-only. Set timezoneId: 'Asia/Kolkata' for timestamps that should show India local time. Preserve date-only semantics where no timezone conversion is intended.
Price uses a rupee symbol but the amount is wrong Formatting a number as INR changes its presentation, not its economic value or exchange rate. Supply an amount already denominated in INR, or perform an explicit, appropriately sourced conversion before formatting.
Price remains in dollars The application may have fixed currency formatting or may provide a USD value and label. For owned code, choose the intended currency code and correct underlying value. For a third-party page, browser locale alone cannot promise a currency conversion.
Screenshot is blank or incomplete Navigation may have failed, content may still be loading, or the relevant content may be below the fold or hidden. Check navigation errors and page text, wait for a page-specific readiness condition, and choose viewport, full-page, or element capture deliberately.
Capture times out The site may be slow, blocked, or waiting on resources that never settle. Use an appropriate timeout, wait for the specific content needed rather than every network request, and inspect whether the page loaded enough to capture.
Agent cannot set locale on its current browser The agent may be attached to an existing session or its browser integration may not expose context emulation. Create a fresh Playwright context with the desired settings, or use an agent/browser integration that exposes locale and timezone configuration. Verify the resulting text.

6. Performance, reliability, and cost considerations

Use the narrowest readiness condition that guarantees the date and price have rendered. Waiting for a whole site’s network to become idle can be slow or unreliable on pages with analytics, polling, or long-lived connections. A selector or application-ready marker is usually a more targeted signal when available. Set a navigation timeout appropriate to the target and handle failures so the agent does not silently return an empty or stale image.

Full-page and high-scale screenshots can take more time and produce larger files than a viewport or element capture. Choose the scope and scale based on what the result needs to show. When capturing many pages, reuse a browser process where appropriate, isolate each page’s context settings, and close pages and contexts after use. Keep locale and timezone in the capture record because a screenshot without its rendering settings can be difficult to reproduce.

With self-hosted Playwright, the main costs are the compute, browser infrastructure, and engineering time you operate; the dossier provides no universal price or benchmark. A hosted screenshot API can reduce browser setup and maintenance, but compare billing rules and supported settings against your workload before adopting one.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. Its locale and timezone options can be set for a capture; a screenshot still reflects the target page’s own rendering logic, so verify whether that site displays the Indian date and currency format you need. The API returns an image or PDF from one GET request. See the ScreenshotNeo documentation for its capture options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await import('node:fs/promises').then(fs => fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer())));

Replace the example URL with the page you need to capture. Add the locale and timezone parameters documented by ScreenshotNeo when the capture should use India settings. Cookie banners, newsletter popups, and chat widgets are removed before the shot; each cleanup step can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are never billed, and the response identifies the page verdict and billing status in headers. Its MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf. 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.

FAQ

Will setting en-IN convert every date and price on a website?

No. It influences locale-sensitive browser behavior. The website must use that locale, or its own application code must format the values accordingly.

Should I use en-IN or hi-IN?

Choose the locale that matches the intended reader and language behavior. Use en-IN for English-language India conventions and hi-IN when Hindi locale behavior is wanted.

Does Asia/Kolkata change a date-only value?

Timezone conversion is meaningful for timestamps representing instants. A date-only value may have no timezone and should not be shifted without an application-specific reason.

Does formatting as INR convert another currency?

No. It formats a numeric value as INR. Currency conversion and the correctness of the amount are separate operations.