Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Indian government websites

How to Capture Screenshots of Indian Government Websites with Puppeteer

By Freedom251 Team · · 6 min read

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.

Use Puppeteer’s Page.screenshot() method: set the viewport before opening the page, navigate using a readiness condition suited to the page, then save a viewport, full-page, clipped-region, or element screenshot. For example, the script below captures a full-page PNG. Government portals do not share one blanket automation policy, so check the specific site’s rules and do not bypass access controls.

Capture a government website with Puppeteer

Install Puppeteer in a Node.js project, save this as capture.mjs, and run it with node capture.mjs. Replace the example URL with the public page you are authorized to capture.

As an Amazon Associate I earn from qualifying purchases.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  // Set these before navigation for a repeatable layout.
  await page.setViewport({ width: 1365, height: 900, deviceScaleFactor: 1 });
  await page.goto('https://example.gov.in/', { waitUntil: 'networkidle2' });
  await page.screenshot({ path: 'government-page.png', fullPage: true });
} finally {
  await browser.close();
}

The URL and 1365-by-900 viewport are examples, not requirements. Choose and record a viewport and device scale factor that fit your intended use. Puppeteer advises setting the viewport before navigation: changing it later can cause a reload on some sites. Its current API documentation surfaced as version 25.12.0 on October 3, 2026; confirm details against the version installed in your project. Puppeteer screenshot guide · Page.setViewport API

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

Install and run

In an existing Node.js project, install Puppeteer with npm install puppeteer. The package downloads a compatible browser as part of its normal installation. Save the script with an .mjs extension to use the shown ES module imports without additional project configuration, then run it from that project directory.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Choose when the page is ready

waitUntil: 'networkidle2' is an option shown in Puppeteer’s screenshot guide; it is not a guarantee that all visible content has finished rendering. Some pages keep network connections open or load content after navigation has settled.

Wait for a page-specific element

If the content you need has a stable selector, wait for it explicitly before taking the screenshot. For example, after page.goto(...), add:

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB | 1920×1080 LED Monitor, 4ms GtG, Adaptive Sync, HDMI 1.4, Tilt Adjust, Low Blue Light, 4yr Advance Replacement Warranty
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
await page.waitForSelector('main h1', { visible: true, timeout: 15000 });

Replace main h1 with a selector that identifies the content you actually need. waitForSelector() resolves when the selector appears; its visibility option and timeout let you avoid capturing before that target is shown. If no stable selector exists, choose a documented wait condition or delay appropriate to that page rather than treating one wait setting as universal. Page.waitForSelector API

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

Choose the screenshot area and format

The capture scope should match the task. Puppeteer documents viewport and full-page screenshots, clipping a rectangle, and screenshots of a selected element. Screenshot options

Rank #3
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Capture Use it for How
Viewport A reproducible view of what fits on screen at one selected size. Call page.screenshot({ path: 'page.png' }); omit fullPage or set it to false.
Full page A single image of the full scrollable page. Set fullPage: true.
Clipped region A fixed rectangle, such as a chart or notice area. Pass a clip rectangle with the desired coordinates and dimensions.
Element A particular component selected from the DOM. Find it with page.$() and call its screenshot() method.

Capture one element

const target = await page.$('#notice');
if (!target) throw new Error('Target element was not found');
await target.screenshot({ path: 'notice.png' });

Replace #notice with the target page’s selector. Puppeteer’s element screenshot method attempts to scroll a hidden element into view before capturing it. Puppeteer screenshot guide

Capture a defined rectangle

await page.screenshot({
  path: 'region.png',
  clip: { x: 100, y: 120, width: 800, height: 500 }
});

Those coordinates are examples; set them for the page layout and viewport you use. A clip is a geometric region, not a selector, so it may no longer enclose the intended content if the layout changes.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor | 100Hz, Game Mode, Advanced Eye Comfort, HDMI and D-sub Ports (LS27D366GANXZA)
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Choose an image type

The screenshot options support selecting an image type and encoding. The output path and type should agree—for example, use a PNG path for PNG output. A quality setting is relevant to supported lossy formats, not PNG. Consult the options reference for the installed Puppeteer version before relying on less common settings. Screenshot options

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

Respect the target portal’s rules and access controls

GIGW guidance covers Indian government websites and apps at central and state levels, as well as district and local administrations. Its goals include usability, consistency, security, and accessibility; it is not a Puppeteer manual and does not establish blanket permission to automate every government site. Check the actual portal’s own terms and policies before capturing it, particularly for authenticated services, personal information, frequent requests, or reuse of captured content. Guidelines for Indian Government Websites and Apps (GIGW)

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

The GIGW Website Policies page applies to that site, not all government portals. It says: “Also, we do not permit our pages to be loaded into frames on your site.” Do not generalize that site-specific statement as a universal rule. GIGW Website Policies

  • Do not attempt to defeat a CAPTCHA, login control, rate limit, or other access restriction. If a CAPTCHA or protected service blocks access, obtain permission or use an authorized test environment.
  • GIGW accessibility guidance discusses CAPTCHA alternatives, including text alternatives and alternate sensory modes; that discussion does not authorize bypassing a CAPTCHA.
  • A screenshot records a visual state. It does not establish that a page is accessible or conforms to GIGW. The guidance references WCAG 2.1 and requirements such as text alternatives.
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 content: The page may not have rendered the target when capture ran. Wait for a stable, visible selector with waitForSelector(), and check that the chosen selector exists on the page.
  • Navigation times out: A page may not reach the selected navigation condition, especially if it keeps network activity open. Reconsider the readiness condition and wait for the specific content needed rather than assuming network idle means visual readiness.
  • The page layout differs between runs: Set viewport dimensions and device scale factor before navigation, and keep them consistent. A later viewport change can trigger a reload on some sites.
  • An element screenshot fails: Check that the selector matches an element and that the page reached the state where it exists. Puppeteer attempts to scroll the element into view, but that does not make a missing selector available.
  • A portal presents a CAPTCHA, login, or block page: Stop rather than bypassing the restriction. Request authorization or use the site operator’s approved test route.
  • The saved file is not the expected format: Match the screenshot type, if specified, with the filename extension. Remember that the quality option does not apply to PNG.

Or skip the browser setup

ScreenshotNeo can return a screenshot or PDF from one GET request. It accepts cookie or consent banners as a visitor 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/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the page verdict and billing status in X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients.

Here is the one-call cURL example. Replace the URL with the public page you are authorized to capture and supply your API key:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. ScreenshotNeo also offers full-page and element captures, viewport and device settings, PDF output, custom waits, and other capture controls. Sign up for 1,000 free screenshots a month with no card.

Frequently Asked Questions

Does a Puppeteer screenshot prove a government page is accessible?

No. It records a visual state; accessibility and conformance require separate evaluation.

Can I use a screenshot of a government page in a report or publication?

Check the specific portal’s policies and any applicable permission requirements for reproducing its content.

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.

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

Indian government websitesNode.jsPuppeteerweb 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
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair 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.