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 Puppeteer’s Page.screenshot() method: set the viewport before navigating, wait for the page or the specific content you need, then choose a viewport, full-page, clipped-region, or element capture. The example below saves a full-page PNG; replace the placeholder URL with a site you are authorized to access.
Capture a government website with Puppeteer
The example uses Puppeteer’s documented screenshot workflow. It sets a reproducible viewport before navigation and waits for network activity to become idle before taking a full-page screenshot.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
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();
}
Save this as an ES module, install Puppeteer in the project, and run it with a Node.js version and Puppeteer version supported by your setup. The URL is only an example; the 1365 × 900 viewport and device scale factor of 1 are choices for this illustration, not required settings. Puppeteer’s screenshot guide documents this workflow and Page.screenshot() (Puppeteer screenshot guide).
Choose when the page is ready
waitUntil: 'networkidle2' is a documented navigation option, not a guarantee that every delayed or dynamic part of a page has rendered. If the screenshot must include a known content element, wait for that element instead of relying only on network activity.
#1 Best Overall
- 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
await page.goto('https://example.gov.in/', { waitUntil: 'domcontentloaded' });
await page.waitForSelector('main .notice-list', { visible: true, timeout: 15000 });
await page.screenshot({ path: 'notices.png', fullPage: true });
Replace main .notice-list with a stable selector on the target page. Page.waitForSelector() resolves when the selector appears and supports visibility checks and a timeout (Puppeteer waitForSelector API). If the content has no reliable selector and appears after a delay, choose and document a suitable wait condition for that site rather than treating one delay as universal.
Pick the capture area and output
| Capture | How | Best for |
|---|---|---|
| Viewport | Call page.screenshot() without fullPage. |
A record of what fits on screen at the chosen viewport size. |
| Full page | Set fullPage: true. |
A single image covering the full scrollable page. |
| Rectangle | Provide a clip rectangle in the screenshot options. |
A defined area of the page. |
| DOM element | Find the element and call its screenshot() method. |
A specific notice, table, or other component. |
Puppeteer’s Page.screenshot API documents options including fullPage, clip, output path, and image type. For a selected element, ElementHandle.screenshot() attempts to scroll it into view if it is not visible (Puppeteer screenshot guide).
Rank #2
- 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
const notice = await page.$('main .notice');
if (!notice) throw new Error('Notice element was not found');
await notice.screenshot({ path: 'notice.png' });
Screenshot options also support image type and encoding. Quality applies to supported lossy formats and does not apply to PNG; consult the API documentation for the options available in the Puppeteer version you use.
Set a reproducible viewport
Set the viewport before navigation whenever layout matters. Puppeteer notes that some sites do not expect the page size to change and that changing certain viewport properties can trigger a reload (Puppeteer setViewport API). Record the viewport dimensions and deviceScaleFactor alongside the screenshot if you need to reproduce its appearance later. There is no single correct size for every portal: choose dimensions that match the view or layout you need to document.
Rank #3
- 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.
Respect the target portal’s rules
Government websites and apps in India span central and state services as well as district and local administrations. The Guidelines for Indian Government Websites (GIGW) address goals such as usability, consistency, security, and accessibility, but they are not a Puppeteer manual and do not establish one blanket permission for automated screenshots across all portals (GIGW).
- Check the specific portal’s website policy and access rules before automating it, particularly for authenticated services, personal information, high request volumes, or reuse of captured content.
- Do not bypass a CAPTCHA, login control, rate limit, or other access restriction. If one blocks capture, use an authorized test environment or ask the site operator for permission.
- GIGW’s accessibility guidance discusses text alternatives and alternate sensory modes for CAPTCHA; that guidance is not permission to automate or bypass a challenge.
- A screenshot is a visual record, not evidence that a site meets accessibility requirements or conforms to GIGW. The cited GIGW accessibility guidance references WCAG 2.1 and requirements including text alternatives.
The GIGW Website Policies page applies to GIGW’s own site, not every government portal. It says, “Also, we do not permit our pages to be loaded into frames on your site,” and identifies NIC, Ministry of Electronics and Information Technology, Government of India as that site’s designer, developer, and maintainer (GIGW Website Policies). Do not generalize that site-specific policy to other portals.
Rank #4
- 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
Troubleshoot common capture problems
- The screenshot misses content that loads late: wait for a stable, visible selector for the required content. If there is no suitable selector, choose a site-specific wait condition and verify the result.
- The expected component is absent: check that the selector matches the live page and that the element exists before calling
ElementHandle.screenshot(). The example throws an explicit error when no element is found. - The layout differs from the expected capture: set the viewport before navigation and keep its width, height, and device scale factor consistent between runs.
- Navigation never reaches the chosen readiness condition: a network-idle condition may not be suitable for every site. Use a more appropriate condition, such as navigation followed by waiting for a specific selector, and set an explicit timeout where supported.
- A CAPTCHA, login, or access restriction blocks the page: stop rather than attempting to defeat it; seek permission or use an authorized test environment.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a screenshot or PDF. For example, this cURL request saves a WebP screenshot of a public page:
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.gov.in/ -o shot.webp
See the ScreenshotNeo documentation for setup and options. Cookie banners and consent dialogs, newsletter popups, and chat widgets are handled before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers reporting the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and other MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month without a card.
Best Value
- 【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.
Frequently Asked Questions
Can Puppeteer capture just one element instead of the whole page?
Yes. Use the element handle’s screenshot() method; Puppeteer attempts to scroll the element into view if needed.
Does a successful screenshot prove an Indian government website is accessible or GIGW-compliant?
No. A screenshot records visual output; it does not establish accessibility or GIGW conformity.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →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.

