Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
FREEDOM251

Freedom251 › Blog › browser automation

How to Screenshot a GST Portal Page with Puppeteer After Login

By Freedom251 Team · · 5 min read

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

Use Puppeteer’s page.screenshot() after you have completed the portal’s normal, authorized login flow and confirmed the intended page is ready. The URL, login steps, and readiness selector depend on the GST portal and page; this example deliberately leaves those account-specific details to you.

Capture a GST page after an authorized login

Puppeteer’s documented page-capture method is Page.screenshot(). A reliable workflow is to open the relevant official portal, complete login through its normal process, wait for a page-specific sign that the target page has loaded, and then save the image. GSTN’s GSTR-9 tutorial describes logging in at gst.gov.in before navigating to the annual-return function, but it is a guide to that workflow—not a current map of every portal page or a source for selectors. See the GSTN GSTR-9 offline-utility tutorial.

As an Amazon Associate I earn from qualifying purchases.

Runnable capture pattern

Install Puppeteer in your project with npm install puppeteer. Save the following as gst-screenshot.js, replace the target URL and readiness selector with values appropriate to the page you are authorized to access, then run node gst-screenshot.js. The script pauses for you to complete login in the opened browser; it does not automate credentials or bypass verification.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({ headless: false });
  try {
    const page = await browser.newPage();
    await page.goto('https://www.gst.gov.in/', { waitUntil: 'domcontentloaded' });

    // Complete the portal's normal login and any verification in the browser.
    // In the terminal, press Enter after the intended page is open.
    await new Promise((resolve) => {
      process.stdin.resume();
      process.stdout.write('After login, open the target page, then press Enter here. ');
      process.stdin.once('data', resolve);
    });

    // Optional: replace this with a selector unique to the target page.
    // await page.waitForSelector('YOUR_PAGE_READY_SELECTOR');

    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;
});

The official Puppeteer guide recommends Page.screenshot() for screenshots; consult its screenshot guide and Page.screenshot() API for current options. The domcontentloaded event only means the initial document has been parsed. It does not prove that a post-login page, its data, or a delayed widget is ready.

Choose a readiness check and capture area

Wait for the page you actually need

For an automated flow, wait for a stable, page-specific indicator—such as a heading or table that appears only on the intended screen—using page.waitForSelector(). Identify and verify the selector on the target page yourself; no selector or timeout is established for every GST page. If the flow is interactive, as in the example, open the destination page manually and capture only after it is visibly complete.

Full page or one element

  • Use await page.screenshot({ path: 'gst-page.png', fullPage: true }) when the whole document is needed. Long pages may create a very tall image.
  • For a particular panel or table, capture its element instead: const element = await page.$('YOUR_ELEMENT_SELECTOR'); if (!element) throw new Error('Target element not found'); await element.screenshot({ path: 'gst-panel.png' }); Replace the selector with one verified for the page. Puppeteer’s guide notes that an element screenshot scrolls the element into view if it is hidden.
  • For a viewport-only image, omit fullPage: await page.screenshot({ path: 'gst-viewport.png' }).

Use the official Puppeteer screenshot guide for additional capture options and examples.

Handle login, verification, and sensitive information safely

Use an account and session you are authorized to access. Do not put real credentials in a script, source repository, or published example. If the portal asks for CAPTCHA or another verification, complete it through the normal authorized flow; the available portal material does not support bypassing those controls. Puppeteer can get, set, and delete browser cookies, but that capability is not a reason to copy live authentication cookies or evade login. See the Puppeteer cookie guide.

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

Portal behavior varies. An official IRIS IRP registration page describes a user ID and password login, possible CAPTCHA details, and an eight-hour session for that distinct GST e-invoicing portal. Those details should not be assumed to apply to the GST Common Portal at gst.gov.in. Consult the relevant portal’s own instructions for your account and destination.

Authenticated screenshots can expose taxpayer, account, or other sensitive information. Inspect the image before sharing it and store it appropriately. The cited portal material does not establish a specific retention or redaction rule.

Troubleshooting

  • The screenshot shows the login page. The browser may not have completed login, may have landed back on a sign-in screen, or may not have reached the intended destination. Complete the normal login, navigate to the target page, and verify it visually before capturing.
  • The image is blank or missing page content. A navigation event such as domcontentloaded can occur before dynamic content appears. Wait for a verified page-specific element or use the interactive pause, then capture.
  • The selector wait times out. The selector may not exist on that page, may differ by portal or account, or may be checked before navigation finishes. Confirm the destination and selector in the browser; do not assume a selector from a different GST workflow applies.
  • The element is not found. Check that the element is present in the current page and that the selector is correct. Capture the viewport or full page if an element-level image is not necessary.
  • The image omits content below the fold. Set fullPage: true for the entire document, or capture the specific element containing the needed content.
  • Login verification appears. Complete it through the portal’s normal flow. CAPTCHA and session requirements are portal-specific; do not treat IRIS IRP’s stated eight-hour session as a general GST portal rule.

Or skip the browser setup

If you only need a URL captured and already have legitimate access to it, ScreenshotNeo offers a screenshot API and MCP server. Its API can return a PNG, JPEG, WebP, or PDF from one GET request. It cannot log in to a GST account for you: use it only for a page that is publicly reachable or otherwise accessible without your private authenticated browser session.

Example request (replace the URL with a page you are authorized to capture):

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://www.gst.gov.in/ -o shot.webp

See the ScreenshotNeo API documentation for parameters. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server gives AI agents screenshot, page-info, and PDF-capture tools. The free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000. Sign up for free.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequently Asked Questions

Can Puppeteer bypass GST portal CAPTCHA?

No. Complete CAPTCHA or other verification through the portal’s normal authorized flow; this guide does not provide a bypass.

Best Value
The SQL Programming Language: .
  • Used Book in Good Condition

Does the example save a full-page image?

Yes. It sets fullPage: true; remove that option for a viewport capture.

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.

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.

browser automationGST PortalNode.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
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.