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
Wait for the invoice’s displayed totals to reach a page-specific ready state before taking a Puppeteer screenshot. A non-empty total and a cleared loading indicator are better evidence than a fixed delay; network idle can help settle the page, but cannot prove the figures are final.
Wait for the invoice totals, not just the page
Invoice totals may be calculated or updated after the initial document renders. The reliable gate is a condition tied to the invoice application: for example, the total element contains a value in the expected format and the totals-loading indicator is gone. Replace the example selectors below with stable selectors from the invoice page; they are illustrative, not universal.
Puppeteer’s screenshot guide covers page and element screenshots. Its interaction guide demonstrates locator-based waiting, including a function condition; the Page API documents condition, selector, and response waits.
Runnable JavaScript example
Set INVOICE_URL to a page you can access. Update the selectors and final-value check to match its markup and currency formatting.
#1 Best Overall
- Auto Cutter and High-Speed Printing: The thermal receipt printer features high efficiency with auto cutter and the fastest printing speed of 300mm/sec. Easy for paper installation, easy maintenance, and excellent structure. Plug and play USB PORT, easy to use. Three Interface ports: USB+ LAN + SERIAL PORT. Does NOT support Wifi or Bluetooth. Compatible with WIN2003/WINXP/WIN7/WIN8/WIN10/LINUX/Mac
- Wall Hanging Design: Kitchen printer with two hanging holes on the bottom support wall mount hanging. Easy to use, save the place. With auto cutter and compatible with several operating systems. Print width: 79.50.5mm; Paper Width: 3 1/8 inch (80mm)
- Wide Compatibility and Reasonable Design: Desktop or wall-mounted type for option, lets you use every space more rationally. The humanized auto-cutter ensures the receipt will not fall to the ground after printing. One-button open cover and large paper warehouse design, easy to use and maintain. Works with MUNBYN 3 1/8 x 203ft thermal paper and Gorilla 3 1/8 x 230 Thermal Paper Receipt Rolls
- Cost-Effective Operation: Supports cash drawer driving, compatible with ESC/POS print commands. The network receipt printer does not need ribbon or ink cartridge, resulting in low operating cost. The printer has the function of overheating protection for long service life. Printing characters with high speed and reliable performance for receipt printing in large shopping malls, supermarkets, retail, hotels, canteens, and restaurants
- Compatibility Notice: The receipt printer is not compatible with Grubhub, Doordash, Square, Chromebook, Uber, or Clover systems. Rongta is a brand dedicated to offering high quality products and good shopping experience for customers
const puppeteer = require('puppeteer');
async function captureInvoice() {
const invoiceUrl = process.env.INVOICE_URL;
if (!invoiceUrl) throw new Error('Set INVOICE_URL to the invoice page URL');
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage();
await page.goto(invoiceUrl, {
waitUntil: 'domcontentloaded',
timeout: 30_000,
});
await page.waitForFunction(() => {
const total = document.querySelector('[data-testid="invoice-total"]');
const loading = document.querySelector('[data-testid="totals-loading"]');
const text = total?.textContent?.trim() ?? '';
// Replace this check with the invoice's actual final/settled-state rule.
return text !== '' && !loading;
}, { timeout: 15_000 });
await page.screenshot({ path: 'gst-invoice.png', fullPage: true });
} finally {
await browser.close();
}
}
captureInvoice().catch(error => {
console.error('Invoice capture failed; no screenshot should be treated as complete:', error);
process.exitCode = 1;
});
The script deliberately fails if the condition does not become true before the timeout. That makes a missing selector, stalled calculation, or changed page state visible instead of quietly saving an incomplete invoice.
Make the readiness condition meaningful
A total element existing in the DOM is not enough if it initially contains a placeholder, zero, or an intermediate calculation. If possible, check the expected final value or a stable application state that means calculation is finished. For example, require the loading indicator to be absent and the total text to match the format or value your workflow expects. Do not assume a particular GST currency format or selector across invoice systems.
If totals arrive through a known API response, page.waitForResponse() can be useful, but treat it as a cue to verify the rendered total—not as a substitute for verifying the UI. A response can complete before the page has updated its displayed values.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Rank #2
- 【Fast Printing & Auto Cutter】The pos printer high efficiency with auto cutter and printing speed--250mm/sec. Easy for paper installation, easy maintenance, easy to use.Three Interface ports:USB+ LAN + SERIAL PORT.DO NOT-Wifi-Bluetooth.
- 【Wall Hanging Design】 Kitchen printer with two hanging holes on the bottom support wall mount hanging. Easy to use, save the place. With auto cutter and compatible with several operating systems. Print width:79.5±0.5mm; Paper Width:3 1/8" (80mm).
- 【Wide Compatibility&Reasonable Design】Desktop or wall-mounted type for option, lets you use every space more rationally. The humanized auto-cutter, the receipt will not fall to the ground after printing. One-button open cover and large paper warehouse design, easy to use & maintain. Work with MUNBYN 3 1/8 x 203ft thermal paper,MFLABEL thermal receipt paper.
- 【Most Cost-effective】Support cash drawer driving, compatible ESC/POS print commands.Do not need ribbon/ink cartridge, low operating cost. The printer has the function of overheating protection, long service life. Printing characters with high speed, reliable performance.It is an ideal choice for receipt printing in large shopping malls, supermarkets, retail, hotels, canteens, restaurants, etc.
- 【Buy with Confidence】 Rongta is a brand that is dedicated to offering the highest quality products and good shopping experience for the customer. Warm tips:The receipt printer is not compatible with Ubereats/Grubhub/Doordash/Lightspeed/Postmates/Square/Chromebook/Clover.
Choose the right wait strategy
| Strategy | What it tells you | Best use | Limitation |
|---|---|---|---|
| Application-state condition | The page’s known total/loading state meets your defined rule. | Primary gate for an invoice screenshot. | Requires selectors and a reliable definition of “complete” for that invoice page. |
| Network idle | Network activity has quieted for the configured idle period. | Optional settling step when late requests affect rendering. | It measures network activity, not correctness or finality of invoice calculations. |
| Fixed delay | A chosen amount of time elapsed. | Rarely useful as a supplement for a known animation or delayed transition. | Can be too short on slow runs and waste time on fast runs; it does not verify totals. |
Puppeteer’s Page.waitForNetworkIdle reference describes waiting for network idleness and notes that it waits at least the configured idle time. Prefer the invoice-specific condition; add network idle only when it addresses a real late-resource issue.
Capture the whole invoice or only its totals
Full-page capture
Use page.screenshot({ path: 'gst-invoice.png', fullPage: true }) when the screenshot needs the invoice context, line items, tax breakdown, and totals together. Full-page capture can include content beyond the current viewport.
Totals-region capture
When only the totals block is needed, wait for its ready condition and capture the element. Puppeteer documents ElementHandle.screenshot() in its screenshot guide.
Rank #3
- High-speed printing of 43 receipts per minute (250mm/s) with easy to setup USB connection - just Plug and Print; USB serial number feature means the PC will detect the TSP143IIIU on its Windows platform using any USB port
- Compatible with iOS, Android, and Windows for a simple setup process
- The "Drop-In and Print" clamshell design allows for fast and easy paper loading; patented "De-Curl" function always delivers a flat receipt
- The TSP143IIIU USB model is certified with the following companies: Postmates, Square, Chromebook, and Clover
- The small footprint and embedded power supply saves precious counter space
const totals = await page.waitForSelector('[data-testid="invoice-totals"]', {
visible: true,
timeout: 15_000,
});
if (!totals) throw new Error('Invoice totals region was not found');
await totals.screenshot({ path: 'gst-invoice-totals.png' });
The example waits for visibility, but visibility alone does not prove the figures are final. Use the same application-state check before capturing the element.
Or skip the browser setup
For a one-request screenshot, ScreenshotNeo accepts a URL and returns an image or PDF. It is not a Puppeteer script, so use it when you want a hosted screenshot API rather than custom browser automation. Its clean-shot workflow accepts cookie/consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. An MCP server provides screenshot tools for AI agents, including Claude, Cursor, and other MCP clients.
For example, this cURL request captures a URL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Replace the example target with the invoice URL and use your API key. See the ScreenshotNeo API documentation for request options and response details. A direct URL capture does not replace a page-specific readiness check when invoice totals are updated dynamically; use a workflow that can verify the totals if that condition matters.
ScreenshotNeo includes 1,000 screenshots a month on its free plan with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo.
Rank #4
- Compatibility Information: Please ensure that our receipt printer is compatible with your device.The Ethernet interface supports Windows, Mac OS, Linux, VirtualCom, Android, RaspberryPi and iOS. But the USB interface could only support Windows, Mac OS, Linux, VirtualCom and Android. Additionally, it does not support Ubereats, Grubhub, Doordash, Postmates, Clover, or Shopify for POS software.
- Fast Printing & Auto Cutter: This high-efficiency thermal receipt printer boasts a maximum printing speed of 260mm/s, ensuring quick and efficient printing without any paper jams. The automatic cutter is designed to handle heavy usage and can last up to 1.5 million cuts. With a one-button open cover and a spacious paper warehouse, this POS printer is easy to use and maintain. Additionally, the receipt printers utilizes direct thermal printing technology, eliminating the need for ribbons or ink.
- USB & Ethernet Interface: The receipt printer has USB and Ethernet interfaces, as well as cash drawer RJ11 ports. However, it does not support Bluetooth or WiFi printing. With a 203 dpi resolution, the Ethernet receipt printer produces high-quality prints that are sharp and clear. To develop custom applications on Ethernet-supported systems like iOS and Android, a software development kit (SDK) is necessary.
- Wall Mount Option: The kitchen printer has a wall mount option with two hanging holes at the bottom, allowing it to easily fit into any space. This USB receipt printer is an excellent choice for various establishments such as restaurants, kitchens, retail stores, grocery stores, clothing stores, supermarkets, cafes, ticket points, food trucks, banks, shopping malls, hotels, canteens, and more.
- Customer Service in the United States: Our team of customer support based in the United States is ready to help you with any problems you may have regarding the integration of the direct thermal printer. Whether you require assistance with setup, connection, compatibility, or any other issues related to the product, please don't hesitate to reach out to us. Additionally, all Volcora products are backed by a limited lifetime warranty, ensuring your peace of mind when making a purchase.
Troubleshooting incomplete or failed captures
- The wait times out: Confirm the selector matches the live page and that the invoice loaded successfully. Inspect whether a loading element remains, and adjust the condition to the page’s actual completion signal rather than merely increasing the timeout indefinitely.
- The screenshot has a blank or placeholder total: The condition may accept initial text. Require a final-value pattern, expected amount, or explicit completed state; verify the display after the calculation step.
- The page is still changing after network idle: Network quiet does not establish that client-side rendering or calculations have finished. Keep the totals condition as the gate and use network idle only as an additional settling wait.
- The response arrives but the screenshot is stale: Wait for the relevant response if useful, then separately wait until the rendered total reflects the result.
- The element screenshot fails or captures the wrong region: Check that the totals container selector uniquely identifies a visible element. Wait for it to be visible and confirm the page’s layout at the capture viewport.
- Capture errors are being treated as success: Let wait timeouts propagate to the caller or explicitly mark the job failed. Do not save or report a successful invoice image when the readiness condition was not met.
Reliability and cost considerations
Use finite timeouts for navigation and readiness waits, and handle failures as failed captures. Choose a timeout based on the application and environment rather than assuming one value fits every invoice. For repeat jobs, log the URL, wait failure, and relevant page state so selector changes or service problems can be diagnosed. Reuse browser processes where appropriate in a managed automation worker, while isolating page state between invoices; always close pages and browsers when a job ends.
The Puppeteer workflow runs in your environment, so its operational cost depends on your browser infrastructure and job volume. The documentation cited here does not establish a general runtime benchmark or a universal wait duration. Test against the invoice application and network conditions you actually use.
Frequently Asked Questions
Can network idle alone confirm that GST totals are ready?
No. It indicates network quiet, not that the displayed calculation is complete. Check the invoice’s own total and loading state.
What if the total changes after it first appears?
Wait for a settled or expected final state, not merely non-empty text, and verify the rendered value before capture.
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.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.

