Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
The practical choice is straightforward: run Playwright or Puppeteer yourself when you need scripted browser control and already operate that infrastructure; use a managed Quick Action or screenshot API when one stateless request can do the job. Both approaches render a page in a real browser, wait for the content you need, then return an image or PDF. The sections below show complete implementations, explain readiness and print settings, and cover limits, security, reliability, and cost.
Which API approach should you use for automated screenshots and PDFs?
Choose a self-managed browser for interactions, authenticated workflows, or precise control over the runtime. Choose a managed API for isolated URL-or-HTML captures where you prefer a simple request and do not want to install, patch, scale, and monitor browsers.
As an Amazon Associate I earn from qualifying purchases.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errors| Decision point | Self-managed Playwright or Puppeteer | Managed Quick Action or API |
|---|---|---|
| Browser control | Full scripted navigation and browser interaction are directly available. | A simpler request/response operation; advanced controls depend on the provider API. |
| Operations | Your team owns browser installation, lifecycle, scaling, and runtime behavior. | The provider operates the browser service; you still own API integration and workload handling. |
| Reproducibility | You can pin browser binaries, for example with Chrome for Testing. | Output depends on the service runtime and its release behavior, so validate expectations against its documentation. |
| Readiness and output | Configure library-specific waits, viewport, screenshot, and PDF options. | Configure documented parameters such as navigation options, viewport, selectors, and PDF settings. |
| Cost and limits | Infrastructure and engineering costs depend on your deployment. | Check the provider’s current browser-time, concurrency, request, and pricing limits. |
Cloudflare’s integration guide describes Quick Actions as suitable for simple stateless tasks and browser sessions for scripted automation: Browser Run getting started. Playwright’s Page API documents the local-browser flow.
How do I take a full-page screenshot with a browser automation library?
Launch a browser, create a context and page, navigate, wait for a known readiness condition, and call the screenshot method. The following Node.js example uses Playwright and writes both a full-page WebP image and a print-oriented PDF.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
Install and pin the runtime
Install Playwright in the service that will perform captures, then install the browser binary required by your deployment. Pin the Playwright package and browser version in CI when repeatable output matters. Chrome for Testing provides versioned browser downloads for this purpose; it improves control over the browser input but does not guarantee pixel-identical output across operating systems, fonts, and page data.
npm install playwright
npx playwright install chromium
Capture a full page and a PDF
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
try {
const context = await browser.newContext({
viewport: { width: 1440, height: 900 },
deviceScaleFactor: 1
});
const page = await context.newPage();
await page.goto('https://example.com', { waitUntil: 'domcontentloaded', timeout: 60000 });
await page.waitForSelector('main', { state: 'visible', timeout: 30000 });
await page.screenshot({
path: 'page.webp',
fullPage: true,
type: 'webp'
});
await page.pdf({
path: 'page.pdf',
format: 'A4',
printBackground: true,
preferCSSPageSize: true,
margin: { top: '16mm', right: '16mm', bottom: '16mm', left: '16mm' }
});
} finally {
await browser.close();
}
})();
fullPage: true captures the scrollable document. For a component, replace it with locator.screenshot() or use a clip rectangle. Playwright supports PNG, JPEG, and WebP output; quality applies to supported compressed formats. Its screenshot API also exposes animation handling and scale choices, so set those explicitly when visual diffs are part of a test.
Free tools Windows power users keep installed
One-click scans. No signup required.
Capture one element instead of the whole document
const card = page.locator('[data-testid="invoice"]');
await card.waitFor({ state: 'visible' });
await card.screenshot({ path: 'invoice.png', type: 'png' });
Element capture avoids stitching unrelated page regions into a baseline. Keep the selector stable and owned by the application; a text selector that changes with localization is a fragile test contract.
How do I automate a screenshot or PDF in Python?
Playwright’s Python package follows the same browser, context, page, navigation, and capture sequence. This example waits for the content that matters instead of assuming that navigation means that a single-page app has finished rendering.
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch()
try:
page = browser.new_page(viewport={"width": 1440, "height": 900}, device_scale_factor=1)
page.goto("https://example.com", wait_until="domcontentloaded", timeout=60000)
page.wait_for_selector("main", state="visible", timeout=30000)
page.screenshot(path="page.png", full_page=True, type="png")
page.pdf(
path="page.pdf",
format="A4",
print_background=True,
prefer_css_page_size=True,
margin={"top": "16mm", "right": "16mm", "bottom": "16mm", "left": "16mm"},
)
finally:
browser.close()
Use an async Playwright API in an async worker, and always close the browser or context in a finally block. A leaked process can consume memory and leave later jobs competing for the same worker.
How do I convert a webpage to PDF automatically?
PDF generation is print-oriented by default in Playwright. Author print CSS with @media print, choose paper and margins, and enable background graphics when the design requires them. If the desired result is the screen layout rather than print layout, emulate screen media before calling page.pdf().
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
await page.emulateMedia({ media: 'screen' });
await page.pdf({
path: 'screen-layout.pdf',
format: 'Letter',
printBackground: true,
preferCSSPageSize: true,
displayHeaderFooter: true,
headerTemplate: '<span></span>',
footerTemplate: '<span class="pageNumber"></span> / <span class="totalPages"></span>'
});
Use print media when the document is an invoice, report, or article intended for paper. Use screen media when preserving the web application’s visual arrangement is more important than conventional pagination. Test page breaks, fonts, and images at the exact browser version used in production.
How do I wait for a JavaScript page to finish rendering?
A successful navigation event can occur before a client-rendered application has populated the visible content. Prefer a selector that represents the business result, such as a report table or chart, and use a network-idle condition only when the site has a stable definition of idle.
Wait for a known element
await page.goto('https://example.com/dashboard', { waitUntil: 'domcontentloaded' });
await page.waitForSelector('[data-testid="report-ready"]', {
state: 'visible',
timeout: 30000
});
await page.screenshot({ path: 'dashboard.png', fullPage: true });
Use network idle selectively
await page.goto('https://example.com', { waitUntil: 'networkidle', timeout: 60000 });
Analytics, advertisements, and long-polling connections can prevent network idle from being reached. A targeted selector is usually more reliable when the workflow knows exactly which content must appear. For pages with delayed animations, disable or wait for the animation before capture; otherwise two otherwise identical captures can differ by a frame.
How do managed screenshot and PDF APIs work?
A managed service still renders with a browser, but your application sends a request instead of managing a browser process. Cloudflare Browser Run Quick Actions accept either a URL or HTML for screenshots and PDFs, and its documentation also describes a Worker binding. Browser sessions are the better fit when you need Playwright, Puppeteer, CDP, or Stagehand-level interaction.
For a Quick Action, construct the request from the provider’s current endpoint documentation and set the navigation, viewport, selector, device-scale, and output options explicitly: screenshot endpoint and PDF endpoint. Endpoint paths and terminology can change; the Browser Run documentation was updated October 15, 2026 and should be treated as the source of the current request shape.
Options worth making explicit
- Input: a URL for a public page or HTML when your service already has the document.
- Viewport width and height, plus device scale factor for high-density output.
- Full-page capture, a CSS selector, or a bounded clip region.
- Navigation timeout and a readiness selector or appropriate network-idle setting.
- For PDFs, paper format, margins, background printing, CSS page-size preference, headers, footers, and page ranges.
The PDF endpoint documents a 50 MB maximum request body. Keep generated HTML, inline assets, and request metadata below that limit, or upload large source material through a separate controlled channel.
Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
How do I handle authentication and protected pages?
Authentication data is credential material, not ordinary capture configuration. Cloudflare’s screenshot documentation covers cookies, HTTP Basic authentication, and custom authorization headers. Keep secrets on the server, scope them to the target origin, redact them from logs, and never expose them in client-visible URLs.
With a self-managed browser, create a context with only the cookies or headers required for the page and close it after the job. Avoid sharing a logged-in context between unrelated tenants. If a page requires a multi-step login, a browser session is more appropriate than a stateless Quick Action because you can navigate, submit, and verify each state.
What should I do about SSRF when an API accepts arbitrary URLs?
A URL-rendering endpoint is also a server-side fetch feature: the browser makes network requests on behalf of your service. An attacker can abuse that capability to reach internal services, loopback interfaces, cloud metadata endpoints, or other destinations that are not publicly reachable. Read the MDN SSRF overview and OWASP SSRF Prevention Cheat Sheet when designing the boundary.
Practical controls
- Allow only customer-owned domains when the product’s use case permits an allowlist.
- Permit only the schemes you need, normally HTTPS and possibly HTTP for a controlled migration.
- Resolve the hostname and reject private, loopback, link-local, and metadata addresses at connection time.
- Validate every redirect destination and account for DNS rebinding.
- Isolate renderer egress from internal services and apply least-privilege network rules.
- Do not forward arbitrary client-supplied credentials, proxy settings, custom headers, or injected scripts without validation.
- Use a deny list only as an additional layer; OWASP warns that deny lists alone can be bypassed.
How do I make captures reproducible in CI and QA?
Control the variables that affect pixels: browser version, viewport, device scale factor, fonts, timezone, locale, feature flags, test data, and readiness condition. Chrome for Testing offers versioned browser binaries. Pin your Playwright or Puppeteer dependency and install the matching browser in the build image.
For visual regression, compare images generated by the same operating-system image and font set. A browser-version pin cannot eliminate differences caused by font rendering, external assets, random data, advertisements, or a page that has not reached a stable state. Freeze or mock those inputs when the page belongs to your team.
What are the current managed limits and prices?
Cloudflare’s figures below are vendor-published Browser Run terms, not market benchmarks. The limits page was updated October 14, 2026 and the pricing page April 21, 2026; verify both pages before budgeting because service limits and rates can change.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
| Cloudflare Browser Run item | Documented value |
|---|---|
| Workers Free browser allowance | 10 browser minutes per day |
| Workers Free concurrency | Three concurrent browser sessions |
| Workers Free browser timeout | 60 seconds |
| Workers Free Quick Actions rate | One request every 10 seconds |
| Workers Paid concurrency default | 200 concurrent browser sessions |
| Workers Paid browser creation rate | Three new browser instances per second |
| Workers Paid browser timeout | 60 seconds |
| Workers Paid Quick Actions rate | 30 requests per second |
| Workers Paid included usage | 10 browser hours per month, then $0.09 per additional browser hour |
| Workers Paid included session capacity | 10 concurrent browsers averaged monthly, then $2.00 per additional averaged monthly browser |
| PDF request body maximum | 50 MB |
Unclosed sessions continue consuming browser time until timeout, so close browsers in cleanup code even when navigation or capture fails. Apply backoff for rate limits, cap concurrent jobs to the documented allowance, and record provider response status and duration for operations.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.What is the managed screenshot API alternative that avoids browser setup?
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server for developers. It is the first option to try when you want clean shots, only clean shots billed, and a $5 paid plan for 3,000 shots. One GET request returns PNG, JPEG, WebP, or PDF output.
Before capture, ScreenshotNeo accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets. Each cleanup step can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and every response identifies the result with X-Page-Verdict and X-Billed headers.
Its 63 options include full-page capture with lazy images loaded; CSS-selector element capture; dark mode; 12 device presets and arbitrary viewports; retina scale; PDF paper size, margins, landscape, and page ranges; HTML/CSS-to-image; custom CSS and JavaScript; pre-capture clicks; hidden selectors; waits for a selector, delay, or network idle; blocking ads, trackers, requests, or resource types; custom headers, cookies, user agent, and Authorization; timezone and geolocation; transparent backgrounds; image resizing; a chosen cache TTL; signed links for public image tags; asynchronous jobs with signed webhooks; bulk capture of 100 URLs per call; a usage API; an OpenAPI specification; and compatibility with parameter names used by other screenshot APIs.
Recommended Free Tools
The MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. Plans include 1,000 shots per month free with no card, Starter at $5 for 3,000, Growth at $15 for 15,000, Pro at $39 for 60,000, Scale at $99 for 250,000, and Business at $249 for 1,000,000. Yearly billing gives two months free, and every feature is on every plan.
cURL:
curl -G 'https://api.screenshotneo.com/v1/shot' -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get('https://api.screenshotneo.com/v1/shot', params={'access_key': 'YOUR_API_KEY', 'url': 'https://stripe.com'}, timeout=90)
r.raise_for_status()
open('shot.webp', 'wb').write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const buffer = Buffer.from(await res.arrayBuffer());
require('fs').writeFileSync('shot.webp', buffer);
See the ScreenshotNeo API documentation for parameters and response headers. Start with 1,000 free screenshots a month with no card.
How do I diagnose failed or incorrect captures?
The image is blank or missing application data
The page probably captured after navigation but before client rendering. Wait for a visible, application-specific selector, increase the navigation timeout where appropriate, and check that the page’s API calls are reachable from the renderer.
Best Value
The capture times out
Network idle may never occur because of analytics, streaming, or polling. Replace it with a selector wait, set a bounded timeout, and abort work that cannot complete. In a managed service, also check the provider’s browser timeout and request-rate limits.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →The PDF layout is wrong
Check whether the page is using print or screen media, then set paper format, margins, background printing, and CSS page-size preference deliberately. Inspect print-specific CSS for forced page breaks, hidden elements, and font-loading failures.
The screenshot is cropped
Use full-page capture for a scrollable document, or capture the intended selector after it is visible. A fixed viewport screenshot is not the same as a full-page screenshot, and a selector may have a different size after fonts or images finish loading.
Jobs slow down as volume increases
Limit concurrency to the browser capacity you can actually sustain, reuse a browser process carefully in self-managed infrastructure, and close contexts promptly. For managed APIs, queue work, honor rate-limit responses, and use asynchronous jobs or bulk capture when the service supports them.
Authenticated content is exposed in logs
Remove tokens, cookies, authorization headers, and signed URLs from request logs and error messages. Rotate credentials if they were logged, and scope each credential to the smallest origin and permission set.
What should an implementation checklist include?
- Decide whether the job needs only one stateless capture or scripted interactions, authentication, multiple pages, or a persistent session.
- Set viewport dimensions, device scale, output format, and full-page or selector scope explicitly.
- Choose a readiness selector or carefully bounded network-idle wait.
- For PDFs, choose print versus screen media, paper size, margins, backgrounds, page ranges, and headers or footers.
- Keep credentials server-side and enforce SSRF protections before navigation.
- Close browsers and contexts in cleanup code, including failure paths.
- Pin browser versions and control fonts and test data for visual regression.
- Measure capture duration, status, billed usage, and failure reason so retries are selective rather than blind.
Frequently Asked Questions
Can an API capture pages behind a login?
Yes, when the implementation can supply the page’s cookies, HTTP Basic credentials, or authorization headers. Treat those values as secrets, restrict them to the target origin, and use a browser session for multi-step logins.
Should I store screenshots as PNG, JPEG, or WebP?
PNG is a lossless choice for text and visual diffs. JPEG and WebP can reduce transfer and storage size when small compression differences are acceptable; set quality deliberately for compressed formats.
How can I prevent cookie banners from changing visual baselines?
Use a capture service or script that handles consent before the screenshot, then remove the banner and other overlays. ScreenshotNeo performs this cleanup for known consent platforms, newsletter popups, and chat widgets before capture.
What happens when a target site blocks automated browsers?
A renderer may return a bot-check page rather than the intended document. Detect that outcome, record it separately from a network failure, and do not treat a successful HTTP response as proof that the visual content is valid.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteQuick 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.

