ScreenshotNeo

BlogHow-to

How to take screenshots of Indian-language websites with Browserless

Capture Indian-language pages with Browserless, wait for content and fonts, and inspect the image for script-specific rendering problems.

By the ScreenshotNeo team4 October 20269 min read

To take a screenshot of an Indian-language website with Browserless, send a JSON POST request to its current /screenshot endpoint with your API token, target URL, and capture options. For dynamic pages, wait for the page’s meaningful content and, where appropriate, try awaiting document.fonts.ready in the page context before capture. That font step is a practical technique to validate on your target site, not a documented screenshot option or a guarantee of correct rendering. Inspect the resulting image for missing glyphs, malformed conjuncts, cut-off marks, unexpected fallback fonts, reflow, and blank regions.

Browserless documents generic screenshot controls, but its reviewed documentation does not guarantee rendering for every Indian language, script, font, or website. The final image is the evidence: check the exact page, viewport, and output format you intend to use.

1. Get a Browserless token and choose the capture method

The REST screenshot endpoint is suitable for a simple request/response capture. Browserless also documents browser automation interfaces, including BrowserQL and BAP, for workflows that need browser operations or code integration. This guide uses the REST endpoint. Keep your token server-side; do not put it in browser JavaScript, public repositories, or logs.

Use the current endpoint pattern POST /screenshot with your token as a query parameter. The request body contains the page URL and an options object. The response is image bytes in the requested format.

2. Capture a full page with cURL

Set the token in an environment variable and substitute the target page. This example requests a full-page PNG, which preserves crisp text edges for inspection.

export BROWSERLESS_TOKEN='YOUR_API_TOKEN'
curl -X POST "https://production-sfo.browserless.io/screenshot?token=${BROWSERLESS_TOKEN}" \
  -H 'Content-Type: application/json' \
  --data '{
    "url": "https://example.org/indian-language-page",
    "options": {
      "fullPage": true,
      "type": "png"
    }
  }' \
  --output page.png

Use the Browserless endpoint host associated with your account if it differs from the example host. The token is a credential; avoid printing the expanded request URL or enabling verbose logging in shared environments.

3. Python example

This complete script posts the same JSON request, checks for an HTTP error, and saves the returned image bytes. Install the dependency with python -m pip install requests.

import os
import requests

TOKEN = os.environ["BROWSERLESS_TOKEN"]
ENDPOINT = "https://production-sfo.browserless.io/screenshot"

response = requests.post(
    ENDPOINT,
    params={"token": TOKEN},
    json={
        "url": "https://example.org/indian-language-page",
        "options": {
            "fullPage": True,
            "type": "png",
        },
    },
    timeout=90,
)
response.raise_for_status()
with open("page.png", "wb") as image_file:
    image_file.write(response.content)

print(f"Saved {len(response.content)} bytes to page.png")

If a capture can take longer on your target page, tune the client timeout to suit your job. A client timeout does not change the browser-side wait options.

4. Node.js example

This example uses Node’s built-in fetch and writes the binary response. Run it in a Node version that provides global fetch, with BROWSERLESS_TOKEN set in the environment.

import { writeFile } from 'node:fs/promises';

const token = process.env.BROWSERLESS_TOKEN;
if (!token) throw new Error('Set BROWSERLESS_TOKEN first');

const endpoint = new URL('https://production-sfo.browserless.io/screenshot');
endpoint.searchParams.set('token', token);

const response = await fetch(endpoint, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    url: 'https://example.org/indian-language-page',
    options: {
      fullPage: true,
      type: 'png',
    },
  }),
});

if (!response.ok) {
  throw new Error(`Browserless returned HTTP ${response.status}: ${await response.text()}`);
}

await writeFile('page.png', Buffer.from(await response.arrayBuffer()));

5. Wait for content and fonts before capture

A screenshot taken immediately after navigation can miss client-rendered text, late-loading fonts, or content that appears after an application request. Browserless’s shared request configuration documents waits by timeout, selector, function, or event. Prefer a signal tied to the page over an arbitrary delay: wait for a visible article heading, a loaded content container, or an application-specific ready condition.

For a language-heavy page, a page-context function can additionally await the browser’s font set. Treat this as a technique to test, because the reviewed screenshot documentation does not provide a dedicated waitForFonts screenshot option. Browserless documents waitForFonts for PDF generation; that PDF option should not be assumed to work as a screenshot option.

The following illustrates the readiness logic to use with a documented function wait in the request configuration. The endpoint’s exact function-wait serialization should follow the current Browserless request-configuration documentation for your account and interface:

async () => {
  await document.fonts.ready;
  const content = document.querySelector('main article');
  return Boolean(content && content.innerText.trim().length > 0);
}

Use a page-specific selector or condition if the site has a more reliable ready marker. A function that waits only for nonempty text may still finish before images or application widgets have settled. Verify the page’s font requests and rendered output rather than treating the promise as proof that the intended font loaded successfully.

6. Select the screenshot extent and output format

Need Control or approach Trade-off
Visible viewport Leave full-page capture disabled Useful for a fixed screen view; content below the fold is absent.
Entire document fullPage: true Captures beyond the viewport; very long pages can produce large images.
One component Use Browserless’s documented selector-based element capture Focuses on a specific content region; confirm the selector matches the intended element.
Fixed rectangle Use the documented clipping options Controls the captured region; coordinates and dimensions must match the rendered viewport.
Sharp text edges type: "png" Lossless output is useful for inspecting script details; it can be larger than compressed formats.
Smaller output Choose documented JPEG or WebP output where appropriate Smaller files may suit delivery or storage; check text and fine marks at the intended quality.

Browserless documents PNG, JPEG, and WebP output. No comparative file-size or quality benchmark is established here. For script QA, begin with PNG so compression artifacts do not complicate visual diagnosis; choose another format after checking the actual result and downstream requirements.

7. Capture lazy-loaded content

Some pages request images or other content only as the user scrolls. Browserless documents scrollPage: true to scroll through the page before capture. Combine it with fullPage: true when the goal is a long, complete page, and allow for the additional loading work that scrolling can trigger.

{
  "url": "https://example.org/indian-language-page",
  "options": {
    "fullPage": true,
    "scrollPage": true,
    "type": "png"
  }
}

Scrolling helps expose lazy content but does not guarantee that every site finishes loading it. If sections remain blank, wait for a page-specific selector or inspect whether the site requires interaction, consent, or more time to populate the content.

8. Inspect Indian-language rendering

Open the saved image at its intended display size and zoom in on representative text. Check for:

  • Missing characters shown as empty boxes or replacement symbols.
  • Incorrect fallback fonts or inconsistent glyph shapes within a line.
  • Disconnected or malformed conjuncts and combining marks.
  • Vowel signs or other marks cut off at line edges or clipped by containers.
  • Unexpected line breaks, overlap, or text reflow caused by font metrics.
  • Blank areas where client-rendered content or a font-dependent component should appear.

Repeat the check at the viewport width and scale used by your real workflow. Text wrapping, responsive CSS, and font fallback can change with viewport dimensions. Do not infer support for one script from a successful capture of another; verify the target language and page directly.

9. Troubleshooting

Symptom Likely cause What to try
Unauthorized or token error Missing, invalid, expired, or incorrectly passed token Check the token and account endpoint, ensure it is sent as the documented query parameter, and keep it out of public client code.
JSON or protocol error Malformed JSON, wrong content type, or request sent with the wrong method Use POST, set Content-Type: application/json, and validate the JSON body.
HTML error saved as an image The request failed but the client wrote the response body without checking status Check the HTTP status before saving; inspect the response body for the service error.
Screenshot has a blank or incomplete page Navigation succeeded before client rendering or data loading completed Wait for a meaningful selector, function, or event; confirm the ready signal corresponds to visible content.
Indian script appears as boxes or wrong glyphs The required font may not have loaded, may not include the glyphs, or may be replaced by a fallback Try awaiting document.fonts.ready in page context, inspect font requests and computed styles, then check the captured image. This is not a Browserless compatibility guarantee.
Marks or text are clipped Container CSS, line height, viewport width, or crop dimensions clip the rendered text Capture at the intended viewport, inspect the element and clipping region, and compare with a browser view at the same dimensions.
Lower sections or images are missing Lazy loading waits for scrolling or additional page-specific signals Try scrollPage: true with full-page capture and wait for the relevant content to appear.
Request times out The page or configured readiness condition takes longer than the client or service allowance Check that the condition can become true, simplify unnecessary waits, and adjust the client timeout within your job’s limits.
Full-page image is unexpectedly large A tall document at a large viewport creates many pixels Capture only the needed element or clip a region when full-page output is not required; use an appropriate supported image format.

10. Performance, reliability, and cost considerations

Capture time depends on the target page, its network requests, content rendering, and the readiness condition. Full-page scrolling and font or selector waits can add work, while a fixed delay can waste time or still finish too early. Use the narrowest meaningful ready signal and capture only the needed extent. For repeated QA, save the target URL, viewport, options, and output alongside the image so a later comparison uses the same conditions.

Reliability depends on both the screenshot request and the page itself. A successful HTTP response does not prove every script rendered correctly. Check the status before treating response bytes as an image, and inspect representative script details in the output. Browserless’s reviewed documentation does not publish a guarantee for Indian-script font availability or shaping, nor a numeric rendering accuracy, speed, or coverage statistic.

Use the pricing and usage terms associated with your Browserless account when estimating cost; the research available for this article establishes no price or per-capture cost. For workflows capturing many URLs, account for image storage and transfer as well as capture charges.

11. Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. Its one-call API returns an image or PDF, and its documentation describes the request options. For example, this cURL call captures the page as WebP:

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

Python:

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

Node.js:

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

ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots. You should still inspect the output for the script and fonts used by your target page.

Sign up for ScreenshotNeo and get 1,000 screenshots a month free with no card.

12. FAQ

Does Browserless guarantee every Indian language will render correctly?

No such guarantee appears in the reviewed documentation. Check the captured page in the actual script and font combination you need.

Is there a screenshot option named waitForFonts?

The reviewed screenshot options do not document one. Browserless documents that option for PDF generation; for screenshots, a page-context document.fonts.ready wait is a technique to test.

Should I use a screenshot endpoint or browser automation?

Use the REST endpoint for a straightforward request and image response. Choose a browser automation interface when the workflow needs additional browser operations or code-driven interaction.

Which format should I archive?

Choose based on the purpose: PNG is a useful lossless reference for text inspection, while JPEG or WebP may fit workflows where output size matters. Review the chosen format at the required text size.

Sources