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 DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
FREEDOM251

Freedom251 › Blog › JavaScript

How to Take a Puppeteer Screenshot of a UPI Payment Confirmation Page

By Freedom251 Team · · 4 min read

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

Use Puppeteer’s Page.screenshot() after the authorized UPI page displays its confirmation state. Navigation finishing is not proof that a payment succeeded: wait for a success label or receipt element specific to your app, then save the image.

Capture the confirmation after it renders

Install Puppeteer in your project with npm install puppeteer. Replace the example URL below with a page you are authorized to access. The example uses networkidle2 as a navigation condition, then waits for an app-specific success element before capturing.

As an Amazon Associate I earn from qualifying purchases.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.goto('https://your-authorized-test-page.example', {
    waitUntil: 'networkidle2',
  });

  // Replace this selector with a success indicator from your application.
  await page.waitForSelector('[data-testid="payment-success"]', {
    visible: true,
    timeout: 15000,
  });

  await page.screenshot({ path: 'upi-confirmation.png' });
} finally {
  await browser.close();
}

Puppeteer’s documented page-image method is Page.screenshot() (official screenshot guide). The sample selector is illustrative, not a selector known to exist in any particular UPI app. Use a stable success marker in your own application; a visible receipt heading or transaction-status element is usually more useful than waiting an arbitrary number of seconds.

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

Choose what to capture

Viewport screenshot

By default, page.screenshot() captures the visible page area. Use this when the confirmation fits in the current viewport and surrounding interface is wanted.

#1 Best Overall
Sale
Motorola Moto g - 2026 | Unlocked | Made for US 4/128GB | 50MP Camera | Pantone Slipstream, Cellular_Phone
  • Universal unlocked. Compatible with all major U.S. carriers, including Verizon, AT&T, T-Mobile and other prepaid carriers.
  • Super-bright, super-smooth 6.7" display. See your screen clearly even outdoors in sunlight, and enjoy seamless views with a fast-refreshing 120Hz display.*
  • AI-powered camera system. Take stunning photos in any light with the 50MP camera**, look your best with a 32MP selfie cam*****, and capture extreme close-ups.
  • Superfast 5G performance. Unleash your entertainment at 5G speed*** with the MediaTek Dimensity 6300 chipset and up to 12GB of RAM with RAM Boost****.
  • Long-lasting battery + TurboPower charging. Power through day after day with a 5200mAh battery, then get hours of power in just minutes.****

Full-page screenshot

Set fullPage: true when the receipt extends below the viewport:

await page.screenshot({
  path: 'upi-confirmation-full.png',
  fullPage: true,
});

Puppeteer documents fullPage as false by default. Its screenshot options also support clip for a specified region; for a receipt element, an element handle can take its own screenshot. See the ScreenshotOptions API and screenshot guide.

Rank #2
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

Receipt element screenshot

If only the receipt should appear, target its actual selector after the success state is present:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const receipt = await page.waitForSelector('.receipt', { visible: true });
if (!receipt) throw new Error('Receipt element was not found');
await receipt.screenshot({ path: 'upi-receipt.png' });

Replace .receipt with a selector from the page you control or are permitted to automate. Element screenshots avoid unrelated page content, but may omit information outside that element.

Rank #3
Samsung Galaxy A16 5G 128GB Cell Phone, Unlocked Android Smartphone, Large AMOLED Display, Durable Design, Super Fast Charging, Expandable Storage, US Version, 2025, Blue Black (Renewed)
  • Charger NOT Included, 6.7" Super AMOLED FHD+, 90Hz Refresh Rate, 385 ppi, 800 nits (HBM), 1080x2340px, 5000mAh Battery
  • 128GB, 4GB RAM, microSDXC, Exynos 1330 (5nm), Octa-Core, Mali-G68 MP2 or Mali-G57 MC2 GPU
  • Rear Camera: 50MP, f/1.8 (wide) + 5MP, f/2.2 (ultrawide) + 2MP, f/2.4 (macro), LED flash, panorama, HDR; Front Camera: 13MP, f/2.0, Android 14, up to 6 major Android upgrades, One UI 6.1
  • 3G: HSDPA 850/900/1700(AWS)/1900/2100; 4G LTE: 1/2/3/4/5/7/12/13/14/20/25/26/28/29/30/38/39/40/41/48/66/71, 5G: 2/5/25/41/66/71/77/78 SA/NSA/Sub6/mmWave - Nano-SIM + eSIM
  • US Model – Global Connectivity – Compatible with Most GSM Carriers like T-Mobile, AT&T, MetroPCS, etc. Will Also work with CDMA Carriers Such as Verizon, Straight Talk.

Wait for payment success, not just page load

waitUntil: 'networkidle2' is a Puppeteer navigation option, not a guarantee that a payment confirmation has rendered. Some applications update the page after navigation, use delayed client-side rendering, or keep background network requests active. Prefer a known success element; if the app has no stable selector, wait on an application-specific condition rather than treating a fixed delay as proof of success.

For a real transaction page, use only an authorized workflow and do not automate a payment or bypass an authentication or security challenge to obtain a screenshot. The exact login steps and success selector depend on the provider and application; neither is specified by this title.

Rank #4
Sale
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

Protect information shown in the receipt

NPCI’s BHIM-UPI guidelines illustrate a confirmation screen containing “Transaction success” and fields such as reference number, recipient, source account, amount, and transaction date (BHIM-UPI guidelines; the PDF search listing gives an update date of 4 June 2026). Other apps may show different fields or layouts. Treat the screenshot as potentially sensitive: capture only what the authorized task needs and limit where the file is stored or shared.

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

Use a PDF only when you need a document

Page.screenshot() produces an image. For a PDF, Puppeteer has the separate Page.pdf() API, which uses print CSS media by default. Print rendering can differ from the on-screen confirmation, so choose the output format based on how the artifact will be used. See the Page.pdf() API.

Best Value
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to | Prepaid Smartphone- 6.6" 120Hz Display, 5G , 50MP Quad Pixel Camera, Long-Lasting Battery
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common capture failures

  • The image shows a loading screen: Navigation may have completed before the app rendered its result. Wait for the success or receipt element and confirm that the page is in the expected state before capturing.
  • waitForSelector times out: The example selector is not universal. Inspect your own page and substitute its actual success marker; check whether it is inside a frame or appears only after an authorized interaction.
  • The screenshot cuts off receipt details: Use fullPage: true for the whole document or capture the receipt element. A viewport-only image cannot include content outside the visible area.
  • The screenshot includes unrelated content: Capture the receipt element or use clip with coordinates appropriate to the rendered page instead of taking a default viewport image.
  • Navigation never reaches network idle: A page with persistent requests may not satisfy that navigation condition. Use an appropriate navigation condition and then wait for the app-specific success indicator; do not infer success from network quiet alone.
  • The file is missing after an error: Ensure the output directory exists and that the process can write there. The finally block closes the browser even when navigation or capture fails.

Or skip the browser setup

ScreenshotNeo can return a page screenshot from one GET request. Cookie banners are accepted and 60+ known consent platforms, newsletter popups, and chat widgets are removed before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server provides screenshot tools for AI agents. This is a general website capture service, not a way to access private payment data or bypass a UPI app’s authentication.

ScreenshotNeo supports PNG, JPEG, WebP, or PDF output. For a public or authorized test page, the cURL call below saves a WebP screenshot; consult the API documentation for output options and parameters.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo to start with the free monthly allowance.

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

Frequently Asked Questions

Can I use a screenshot as proof that a UPI payment succeeded?

No. A screenshot records what was displayed; verify the transaction through the payment provider or its authoritative transaction history.

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.

JavaScriptPuppeteerscreenshotsUPIweb automation

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
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver 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.