Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
A Pyppeteer NetworkError that appears after about 20 seconds is not proof that Pyppeteer has a 20-second timeout. The documented default navigation timeout for page.goto() is 30,000 milliseconds. The failing operation might instead be a different wait, an override in your code or job runner, a failed main-document request, a subresource failure, or a request-interception handler that left a request unresolved.
Start by recording the complete traceback, the exact awaited call, the URL, and the Pyppeteer and Chromium versions. Then classify the failure before changing a timeout.
What the 20-second failure actually tells you
The elapsed time is a symptom, not a diagnosis. Pyppeteer’s API reference documents a 30-second default for page.goto(), not 20 seconds (Pyppeteer API reference). A nearly 20-second exception can be caused by:
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 reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match- A per-call or global navigation timeout set below 30 seconds.
- An outer limit such as
asyncio.wait_for(), a test-runner deadline, a queue worker, a serverless function, or a remote browser service. - A browser-level network failure, such as DNS, TLS, proxy, firewall, or socket trouble.
- A failed main document or a later image, script, font, or API request.
- A wait condition such as
networkidle0that never becomes true. - Request interception in which one branch never continues, fulfills, or aborts a request.
Do not begin with timeout: 0. That disables Pyppeteer’s navigation deadline and can turn a bounded failure into an indefinite hang; it cannot repair an unreachable host or an unresolved intercepted request.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
First identify the operation and exception
Capture the full traceback
Log the exact line that was awaited, not merely “the browser failed.” For example, distinguish await page.goto(url, options) from await page.waitForNavigation(), await page.waitForSelector(), or an application-level HTTP request. Include the complete exception text, URL, elapsed time, and any wrapper timeout.
import asyncio
import traceback
from pyppeteer import launch
async def main():
browser = await launch()
page = await browser.newPage()
url = "https://example.com"
try:
print("before goto", url)
response = await page.goto(url, {"waitUntil": "domcontentloaded"})
print("status", response.status if response else None)
except Exception:
traceback.print_exc()
finally:
await browser.close()
asyncio.get_event_loop().run_until_complete(main())
Search your code and deployment configuration for timeout, setDefaultNavigationTimeout, asyncio.wait_for, test deadlines, proxy settings, and job-level limits. A 20-second value may belong to one of those layers rather than to Pyppeteer’s default.
Separate navigation timeout from network failure
According to the API documentation, goto() can raise for an SSL error, an invalid URL, an exceeded navigation timeout, or a failed main resource (Pyppeteer API reference). An HTTP 404 or 500 response is still a response; it is different from Chromium being unable to establish or maintain the navigation. Record whether a response object exists and its status before deciding what to change.
Recommended Free Tools
Instrument request failures
Pyppeteer exposes request, response, requestfinished, and requestfailed events. A failed request includes human-readable errorText. Logging these events tells you whether the main document failed or a secondary resource did (Pyppeteer API reference).
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
def log_request_failed(request):
failure = request.failure or {}
print({
"url": request.url,
"resource_type": request.resourceType,
"is_navigation": request.isNavigationRequest,
"method": request.method,
"error_text": failure.get("errorText"),
})
def log_response(response):
if response.request.isNavigationRequest:
print("main response", response.status, response.url)
page.on("requestfailed", log_request_failed)
page.on("response", log_response)
Look for the main URL first. If only an analytics call, image, or API request fails after the document commits, the navigation may have succeeded and your application should decide whether that optional resource is essential.
Choose the right waitUntil milestone
The waitUntil option controls what Pyppeteer considers navigation complete (Pyppeteer API reference).
| Value | Completion condition | Use it when | Risk |
|---|---|---|---|
domcontentloaded |
The DOMContentLoaded event fires. | You need the document structure and scripts can finish later. | Images, fonts, and late API data may not be ready. |
load |
The load event fires. | Traditional page resources must finish loading. | Slow or failed subresources delay completion. |
networkidle0 |
No more than zero active connections for at least 500 ms. | The page is known to become completely quiet. | Polling, analytics, WebSockets, or streaming can prevent it indefinitely. |
networkidle2 |
No more than two active connections for at least 500 ms. | You need near-idle behavior while tolerating a small amount of traffic. | Continuously active applications may still never satisfy it. |
Changing from networkidle0 to domcontentloaded can avoid waiting for work your task does not need. It is not a cure for DNS, TLS, connection, or interception failures. If you need a specific component, navigate with a suitable milestone and then wait for that component explicitly.
If the traceback explicitly says navigation timeout
Set a per-navigation limit
Use milliseconds in the goto() options. The documented default is 30,000 ms; 0 disables the navigation timeout (Pyppeteer API reference).
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
response = await page.goto(
"https://example.com",
{"waitUntil": "domcontentloaded", "timeout": 60000}
)
Set the page default
setDefaultNavigationTimeout(milliseconds) changes the default for goto, back/forward navigation, reload, and waitForNavigation. Use an explicit finite value that matches your service’s overall deadline.
page.setDefaultNavigationTimeout(60000)
response = await page.goto("https://example.com", {"waitUntil": "load"})
Increasing the limit helps only when the site is slow but progressing. It does not fix an invalid URL, failed certificate, DNS outage, blocked connection, or handler that has stalled requests. Keep an outer deadline so a permanently unreachable site cannot consume a worker forever.
If it is a genuine network failure
Test from the same host
Run a DNS lookup and an HTTPS request from the same machine or container that launches Chromium. Verify proxy environment variables, firewall rules, outbound port access, certificate trust, and system clock. Chromium documents DNS-resolution failure and socket-connection timeout as examples of network errors and explains that navigation and loading are separate phases (Chromium: Life of a Navigation).
A document can commit successfully and then fail while its remaining body or resources load. That is why the main response, request-failure logs, and page content must be examined separately.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Check URL and TLS details
- Pass a complete URL including
https://; reject empty or malformed input before callinggoto(). - Compare the result with a command-line HTTPS client from the same network path.
- Inspect certificate-chain errors, corporate proxy interception, and authentication requirements.
- Try the host without a proxy only when your environment permits it; otherwise configure Chromium and the network consistently.
Audit request interception
When interception is enabled, every request must be resolved with continue_(), respond(), or abort(). A missing branch, swallowed exception, or unawaited handler task can leave page activity waiting indefinitely (Pyppeteer API reference).
async def handle_request(request):
try:
if request.resourceType in {"image", "font"}:
await request.abort()
else:
await request.continue_()
except Exception as exc:
print("interception error", request.url, repr(exc))
await page.setRequestInterception(True)
page.on("request", lambda req: asyncio.ensure_future(handle_request(req)))
For diagnosis, disable interception and repeat the navigation. If the error disappears, re-enable it with exhaustive branches and explicit error logging. Do not silently ignore exceptions in the handler.
Use the Chromium version Pyppeteer expects
Pyppeteer works best with the Chromium bundled for the installed release; its documentation does not guarantee compatibility with arbitrary external Chromium versions (Pyppeteer API reference). Reproduce with the bundled browser before blaming the target site. If you must specify an executable, record its exact version and compare behavior with the bundled binary.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →A practical decision tree
- Exception says navigation timeout: identify every timeout layer, choose an appropriate
waitUntil, and raise the finite navigation limit only if the page is demonstrably progressing. - Exception names SSL, URL, DNS, or connection failure: test the URL from the same host, then fix certificate, DNS, proxy, firewall, or server reachability.
- Main response exists but a later request fails: inspect the failed resource and decide whether to retry, substitute, or ignore it.
- Only network-idle waits fail: replace the idle condition with the milestone your task actually needs and wait for a selector or application signal.
- Interception is enabled: disable it for a control test, then ensure every request path resolves.
- Only an external Chromium fails: repeat with the bundled Chromium and align versions before further changes.
- All browser tests fail from the container: investigate the host’s network path independently of Pyppeteer.
Common symptoms and fixes
| Symptom | Likely distinction | Next action |
|---|---|---|
| Fails at nearly the same 20-second mark in several environments | Configured or external deadline | Search wrappers, runners, queues, and proxies for a 20-second limit. |
Fails only with networkidle0 |
Page keeps connections open | Use a milestone suited to the task and a targeted selector wait. |
Main URL has no response and requestfailed reports DNS/TLS text |
Main navigation network failure | Fix name resolution, certificate, proxy, firewall, or server access. |
| Document response exists; one image or API call fails | Subresource failure after commit | Handle that resource according to whether it is required. |
| Failure appears only after enabling interception | Unresolved or broken handler branch | Resolve every request and log handler exceptions. |
| Bundled browser succeeds; configured executable fails | Unsupported Chromium pairing | Use the bundled version or verify a compatible release. |
Or skip the browser setup
If your goal is a clean screenshot or PDF rather than browser debugging, ScreenshotNeo provides a GET endpoint that captures a URL without maintaining Pyppeteer, Chromium, interception code, or wait handlers. Before capture it accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.
For the complete parameter list and response behavior, see the ScreenshotNeo documentation.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
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)
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}`);
ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. It supports full-page and element captures, device presets and custom viewports, dark mode, retina scale, PDF controls, custom CSS and JavaScript, clicks, selector waits, delays, network-idle waits, request and resource blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, TTL caching, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs also work, which can simplify migration.
The Free plan includes 1,000 screenshots each month without a card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. Create a free ScreenshotNeo account.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsFAQ
Does Pyppeteer always fail after 20 seconds?
No. The documented goto() default is 30 seconds, so the timing alone cannot identify the cause.
Is an HTTP 500 a Pyppeteer NetworkError?
Not necessarily. An HTTP status means the server returned a response; a browser-level navigation failure means the request could not complete normally. Log both.
Should I always use networkidle0 for screenshots?
No. It can be unsuitable for pages with polling, streaming, WebSockets, or continuously open requests. Select the readiness condition that matches the content you need.
What information is still needed to diagnose one specific incident?
The full exception, awaited method, target URL, Pyppeteer and Chromium versions, operating system or container, proxy configuration, and whether interception is enabled.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →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.

