ScreenshotNeo

BlogHow-to

How to Set the Indian Locale in Puppeteer for a Website Screenshot

Set Puppeteer’s page locale to en-IN before navigation, then capture the rendered page. Includes version notes, troubleshooting, and a browser-free API option.

By the ScreenshotNeo team4 October 20266 min read

Set the page locale before navigating, then take the screenshot after the page has rendered:

await page.emulateLocale('en-IN');
await page.goto('https://example.com', { waitUntil: 'networkidle2' });
await page.screenshot({ path: 'screenshot.png', fullPage: true });

Page.emulateLocale(locale) is documented in Puppeteer’s current Next Page API and was added in Puppeteer 25.2.0. Check your installed version before using it; older releases may not expose the method. The documented API lists the method but does not certify every locale tag or guarantee how a particular website will respond to en-IN. Verify the rendered result for your browser and target site. Puppeteer Page API · Puppeteer changelog

1. Install and capture with Puppeteer

Use a current Puppeteer release that exposes emulateLocale. For a Node.js project using ECMAScript modules:

npm install puppeteer

Save the following as screenshot.mjs and run node screenshot.mjs:

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.emulateLocale('en-IN');
  await page.goto('https://example.com', { waitUntil: 'networkidle2' });
  await page.screenshot({ path: 'screenshot.png', fullPage: true });
} finally {
  await browser.close();
}

This example is assembled from Puppeteer’s API references, not reported as a locally executed test. Replace the URL and screenshot options for your use case. The screenshot guide documents navigation followed by Page.screenshot(); no single wait condition guarantees that every dynamically rendered page is ready. Puppeteer screenshots guide

2. What locale emulation changes

Locale emulation configures the browser page’s locale. A site may use that setting when choosing localized content or formatting dates and numbers, but the site controls what it renders. The documentation does not promise a particular site-specific result, so inspect the actual screenshot.

Use en-IN for this Indian English example. Puppeteer’s cited API reference names the method but does not enumerate or certify locale tags. If the site also needs local time behavior, configure timezone separately with page.emulateTimezone(timezoneId). Locale and timezone are distinct settings; choose and verify the timezone identifier needed by your application. Puppeteer timezone emulation

3. Choose the screenshot output

page.screenshot() captures the page. The screenshot options reference documents these commonly relevant options:

Option Purpose Default or note
path Save the image to a file The file extension determines the image type when type is not specified.
fullPage Capture the full page rather than just the viewport Defaults to false.
type Select an image format Use a supported screenshot format; otherwise type can be inferred from the path extension.

For a single element, use ElementHandle.screenshot() instead of capturing the whole page. Review the relevant option references before relying on format-specific settings. ScreenshotOptions · ElementHandle.screenshot()

4. Locale emulation versus request headers

page.emulateLocale('en-IN') is the documented page-locale API. Puppeteer also provides page.setExtraHTTPHeaders() to send additional headers with page requests. The header API does not guarantee header order, and setting an Accept-Language header is not documented as equivalent to locale emulation or as sufficient to localize a site.

Use the mechanism that matches the behavior you need, and check both the request behavior and rendered output when a site depends on them. Puppeteer setExtraHTTPHeaders()

5. Version and protocol limits

  • Version: The Puppeteer changelog records page locale emulation in version 25.2.0, dated 2026-06-24. Confirm the installed package exposes emulateLocale; do not assume an older version supports it.
  • Protocol: Puppeteer’s WebDriver BiDi support page lists locale emulation as unsupported. Its documented BiDi screenshot parameters are clip, encoding, and fullPage. If you rely on BiDi, check the current support page and do not assume this locale workflow is available there.
  • Site behavior: A locale setting cannot force a website to provide Indian English content or formatting. Site logic and available translations determine the result.

Puppeteer WebDriver BiDi support

6. Troubleshooting

Symptom Likely cause What to do
page.emulateLocale is not a function The installed Puppeteer version does not expose the method, or the code is using a different page object. Check the installed Puppeteer version and its API. The changelog records the feature in 25.2.0; upgrade to a release that documents it and confirm the method exists on the page.
The page still looks unchanged The site may ignore browser locale, use its own account or URL setting, or lack Indian English content. Inspect the rendered page and the site’s localization behavior. Locale emulation does not guarantee site-specific output.
Some content is missing from the screenshot The page may still be rendering after navigation returns. Wait for the particular content or page state your site requires before calling screenshot(). Puppeteer’s example wait condition is not a guarantee for every dynamic page.
Locale behavior differs under BiDi Puppeteer documents locale emulation as unsupported in its WebDriver BiDi support page. Check the protocol used by your project and current Puppeteer support documentation. Do not rely on locale emulation through BiDi while it is listed as unsupported.
Dates or clock-dependent content do not match Locale and timezone are separate settings. Configure timezone separately if required, and verify the chosen identifier and page output.
A custom language header does not produce the expected page Extra request headers are separate from page locale emulation; header order is not guaranteed. Use emulateLocale when page locale emulation is supported, and check the site’s own locale behavior.

7. Performance, reliability, and cost

Locale emulation is a page configuration step; the cited Puppeteer sources provide no benchmark or cost figure for it. Capture time and reliability depend on browser startup, navigation, the site’s resources, and how long its dynamic content takes to settle. Reuse a browser process when capturing multiple pages if that fits your application, close it in a finally block, and wait for the specific content you need rather than assuming one network-idle condition fits every site.

For repeatable output, keep the Puppeteer version and browser protocol consistent, set locale before navigation, and verify screenshots against the site’s actual localized behavior. Budget for the browser infrastructure and execution environment you choose; the supplied Puppeteer references do not specify hosting prices.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server for developers. One GET request can return a PNG, JPEG, WebP, or PDF. Its clean-shot flow accepts 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, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status.

For a direct capture, replace the URL and API key with your values:

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

ScreenshotNeo API documentation · ScreenshotNeo

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Create a free account.

FAQ

Should I emulate the locale before or after navigation?

Before navigation, so the page is configured with the desired locale when it loads.

Does en-IN guarantee that a site uses Indian English?

No. The site decides how it responds to locale settings; inspect the actual rendered page.

Will setting Accept-Language do the same thing?

Puppeteer documents extra request headers separately and does not say that this header is equivalent to page locale emulation.

Can I set Indian local time with the locale?

No. Timezone is configured separately with emulateTimezone().