Recommended Free Tools
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() after completing the GST portal’s normal, authorized login and confirming the page you need has finished rendering. The portal URL, login flow, and readiness check depend on the specific page; do not assume a selector or login method that has not been verified for your account.
Capture a page from an authorized logged-in session
Puppeteer’s documented page-capture method is Page.screenshot(). The general workflow is to open the appropriate official portal page, complete login through its normal flow, wait for a page-specific indication that the target content is ready, and then save the image.
GSTN’s GSTR-9 offline-utility tutorial describes logging in at www.gst.gov.in before navigating to that tutorial’s annual-return function. It is a guide to that particular task, not a current map of every GST page or its selectors.
Runnable Puppeteer example
Install Puppeteer in your project with npm install puppeteer. The example opens the portal and pauses for you to complete its authorized login and navigation in the browser. After you press Enter, it captures the currently open page. Replace the URL with the official page appropriate to your task.
#1 Best Overall
const puppeteer = require('puppeteer');
const readline = require('node:readline/promises');
const { stdin: input, stdout: output } = require('node:process');
(async () => {
const browser = await puppeteer.launch({ headless: false });
try {
const page = await browser.newPage();
await page.goto('https://www.gst.gov.in/', {
waitUntil: 'domcontentloaded',
timeout: 60000
});
const rl = readline.createInterface({ input, output });
await rl.question('Complete the authorized login and open the page to capture, then press Enter. ');
rl.close();
// Optional: add a verified page-specific readiness check here.
await page.screenshot({ path: 'gst-page.png', fullPage: true });
console.log('Saved gst-page.png');
} finally {
await browser.close();
}
})().catch(error => {
console.error(error);
process.exitCode = 1;
});
This example deliberately does not automate credential entry or guess a post-login selector. For a repeatable workflow, use a readiness signal that you have confirmed on the exact target page, such as a distinctive heading or table becoming visible. Puppeteer’s waitForSelector() can wait for a selector you have verified; it cannot tell you whether an arbitrary element means the correct account page is ready.
Choose full-page or element capture
Full page
Use fullPage: true when you need the entire scrollable document. Without it, Puppeteer captures the visible viewport. A full-page image can include more taxpayer or account information than the visible area, so inspect the saved file before sharing it.
Rank #2
One element
For a specific panel or table, capture its element instead of the entire page:
const target = await page.waitForSelector('YOUR_VERIFIED_SELECTOR');
if (!target) throw new Error('Target element was not found');
await target.screenshot({ path: 'gst-section.png' });
Replace YOUR_VERIFIED_SELECTOR with a selector confirmed on the authenticated page. Puppeteer’s element screenshot scrolls the element into view if it is hidden.
Authentication, verification, and privacy
- Use only an account and session you are authorized to access. Do not put real credentials in source code, publish them, or treat copying live cookies as a substitute for the portal’s normal login.
- If the portal displays CAPTCHA or another verification challenge, complete it through the portal’s normal authorized flow. This guide does not bypass verification.
- Portal details vary. An official IRIS IRP registration page describes a user ID, password, possible CAPTCHA, and an eight-hour session for that distinct GST e-invoicing portal. Those details should not be generalized to the GST Common Portal.
- Check the resulting image for taxpayer, account, or other sensitive data before sharing it, and store it appropriately. The cited portal material does not establish a specific retention or redaction rule.
Wait for the page you intend to capture
Navigation completion is not necessarily the same as the post-login content being ready. Use the target page’s verified signal, then capture. For example, if a known heading identifies the page, wait for that heading to appear rather than relying only on a fixed delay. Exact selectors and timing are page-specific and are not established for every GST portal page.
If you capture multiple pages or manipulate pages concurrently in one BrowserContext, account for Puppeteer’s screenshot coordination: screenshot operations coordinate with opening and closing pages to avoid interference. Sequential captures are simpler when strict ordering matters.
Rank #4
Troubleshooting
- The page is still at login: Complete login and any verification in the visible browser before proceeding. Confirm that the intended authenticated page is open.
- The screenshot is blank or incomplete: Wait for a page-specific element or content to appear before capture. A navigation event alone may not mean the target content is ready.
- The selector wait fails: The selector may not match the current page, account state, or portal rendering. Inspect the page you are actually capturing and use a verified selector; no universal GST selector is established here.
- The screenshot misses content below the fold: Set
fullPage: true, or capture the specific element if only one section is needed. - The script times out during navigation: Check that the official URL is correct and reachable, then adjust the navigation timeout for your environment. Do not treat a timeout increase as proof that login or page readiness succeeded.
- The browser closes before the file is saved: Await the screenshot call before closing the browser, as in the example. Avoid launching concurrent page changes during capture.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. For a page your authorized workflow can access publicly, one GET request returns an image or PDF. For authenticated portal pages, do not send credentials or session cookies unless your security and access requirements explicitly permit that; a remote screenshot request is not a substitute for the portal’s authorized login flow.
Example request, targeting the portal homepage:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://www.gst.gov.in/ -o shot.webp
See the ScreenshotNeo API documentation for request parameters. ScreenshotNeo removes cookie/consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.
Sign up free for ScreenshotNeo.
Frequently Asked Questions
Can Puppeteer bypass the GST portal CAPTCHA?
No. Complete CAPTCHA or other verification through the portal’s normal authorized flow; the example leaves login and verification to the user.
Best Value
- Used Book in Good Condition
Does this work for every GST portal page?
The capture method applies to a Puppeteer page, but portal URLs, login steps, readiness signals, and selectors vary. Verify them on the exact page and account you use.
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.

