Scraping timeouts: ReadTimeout, Timeout 30000ms exceeded, fixes
What you see
requests.exceptions.ReadTimeoutrequests.exceptions.ConnectTimeoutRead timed out. (read timeout=Max retries exceeded with url
More error strings (24)
Caused by ConnectTimeoutError(timed out. (connect timeout=httpx.ReadTimeouthttpx.ConnectTimeouthttpx.PoolTimeoutpage.goto: Timeout 30000ms exceeded.playwright._impl._errors.TimeoutError: Timeout 30000ms exceeded.playwright._impl._api_types.TimeoutError: Timeout 30000ms exceeded.TimeoutError: Navigation timeout of 30000 ms exceedednet::ERR_TIMED_OUTnet::ERR_CONNECTION_TIMED_OUTcurl: (28) Operation timed out aftercurl: (28) Connection timed out aftercurl: (28) Resolving timed out afterCURLE_OPERATION_TIMEDOUTtimeout of 30000ms exceededUND_ERR_CONNECT_TIMEOUTConnect Timeout ErrorUND_ERR_HEADERS_TIMEOUTscrapy.exceptions.DownloadTimeoutErrortook longer than 180.0 seconds.User timeout caused connection failurePeer did not connect to destination due timeoutProxy-Status: error=connection_timeout
What it means
Your scraper waited for an answer, gave up, and threw a timeout. No one refused you: the clock just ran out.
Which clock matters. A connect timeout means the site (or proxy) never picked up. A read timeout means it picked up, then went quiet.
A browser timeout like page.goto: Timeout 30000ms exceeded means the page didn’t finish loading within 30 seconds.
Why it happens
Think of a phone call. A connect timeout: nobody picks up. A read timeout: someone picks up, then goes quiet for too long.
The usual causes, most common first:
- The browser waits for a “loaded” signal that never arrives. Playwright and Puppeteer wait for the
loadevent by default. Trackers, ads and pixels can keep a page busy long after you can see it. - The site, or even your proxy’s exit, can be slow. Bright Data’s docs say a target that doesn’t answer in time “could indicate the server is down, overloaded, or blocking connections”.
- A silent block. Some sites drop or stall connections from scrapers rather than sending 403. You see a timeout, not a refusal.
- Your limit is shorter than the hops in the middle. Scraper APIs and proxies wait for the site themselves, often 60 seconds or more. If you hang up first, you get a timeout. See 502 and 504 for each API’s own limits.
- Too many requests all at once. httpx raises
PoolTimeoutwhen every connection in its pool (100 by default) is busy and none frees up in time. - The address has several IPs. requests applies its connect timeout per IP. If a dead server has both IPv4 and IPv6 addresses, you can wait twice as long.
The opposite trap is no timeout at all. requests and axios never time out unless you set one, so a stuck request just hangs.
Rotating residential proxies (IPs borrowed from people’s home internet) add their own delay. Every new IP comes from a different home connection, and some of those are slow. Bright Data pitches its ISP proxies as “datacenter speed with residential-registered IPs”.
When a proxy is the one that timed out, it normally tells you:
- Oxylabs residential proxies answer
504 Timeoutwith “Request timed out. Please try again.” Errors from Oxylabs’ own network carry anX-Error-Descriptionheader. - Oxylabs’ dedicated ISP proxies send 504 when the site doesn’t answer: “It usually takes about 60s.”
- Bright Data sends 408 carrying
peer_30040(“Peer did not connect to destination due timeout”) or 502 withDestination host connect timeout.
Fix it
- Read which wait ran out.
ConnectTimeout,Connection timed outorERR_CONNECTION_TIMED_OUT: you never got in.ReadTimeoutorOperation timed out after … with 0 bytes received: you got in, the answer never came. Those strings for each tool are in Dev details. - Set a timeout on every request. In requests, the docs’ own example is
timeout=(3.05, 27): 3.05 seconds to connect, 27 seconds of silence while reading. - Test the URL by itself. Open it in a normal browser, then run
curl -v --connect-timeout 10 --max-time 60 <url>. Slow there too? The site is the problem, not your code. - In a browser, stop waiting for everything. Use
waitUntil: 'domcontentloaded', then look for the element you actually need. Playwright marksnetworkidleas “DISCOURAGED”. - Through a proxy, read its error header first. Bright Data:
x-brd-err-code. Oxylabs:X-Error-Description. A timeout on the proxy’s side usually clears on a new IP or session. - Retry these failures, a few times, with growing waits. requests says a
ConnectTimeoutis “safe to retry”. Scrapy already retries timeouts twice by default. After a read timeout, a scraper API may still finish the job and bill it, so check 502 and 504 before you resend. - Raise the limit only where it is honest. A slow page or a scraper API needs more time. But a dead host doesn’t, so a 5-minute wait there only slows your whole crawl.
- Lower your concurrency if you see
PoolTimeoutor timeouts that start only under load. Then raise the pool size (httpx.Limits(max_connections=…)) when you really need more.
Your timeout must be longer than the proxy’s or the API’s. Bright Data logs your premature hang-up as 499 client_10140 and tells you to make sure “the client waits long enough for the proxy response”.
Did you get a 502 or 504 status rather than a timeout? See 502 and 504. Proxy refused to connect at all? See Python requests ProxyError or ERR_TUNNEL_CONNECTION_FAILED.
What’s the point of splitting connect from read? The two failures mean different things when planning a retry.
A connect timeout means your request never reached the server. That is why the requests source calls ConnectTimeout safe to retry. A read timeout means the request went out and the server “did not send any data in the allotted amount of time”. The server may still be busy with it.
So the numbers you pick follow from that:
- Connect: short. A live server picks up fast. The requests docs suggest just over a multiple of 3 seconds, since that is the default wait before TCP (the layer that carries your request) sends a lost packet again.
- Read: as long as the slowest honest hop. A scraper API or a slow page needs more. A dead host does not need more.
For anything that changes data (a POST, a form), our advice is not to retry a read timeout blindly. Check first whether it went through.
| Vendor, plan it picks | Total a month | $/IP/mo | Total a year | Free trial · note · source |
|---|---|---|---|---|
| Plain Proxies ISP ProxiesShared 250 GB: 10 IP | $3.83 | $0.38 | $45.93 | plainproxies.com · 29 Nov 2026 |
| Webshare ISP Proxies20 IP | $6.00 | $0.60 | $72 | webshare.io · 29 Nov 2026 |
| Evomi ISP ProxiesShared IPs | $10 | $1.00 | $120 | evomi.com · 29 Nov 2026 |
| Toolip ISP ProxiesGlobal ISP: 10 IP | $13.99 | $1.40 | $167.88 | toolip.io · 29 Nov 2026 |
List prices from each vendor’s pricing page, US dollars before tax, live from our price data. Your own size, in the price calculator: ISP proxies.
Paste this into your AI
My scraper fails with this timeout:
"<paste the full error, including everything after 'Caused by'>"
Tell me in plain words which wait ran out: connecting, waiting for the first byte,
the browser's page load, or a proxy or scraper API in the middle.
Then list the likely causes in order, most likely first.
For each cause, give one quick test and one fix.
Show a curl -v command with --connect-timeout and --max-time that tests the same URL.
My setup: <language + library or browser tool>, <the URL pattern>,
<direct, proxy (provider, residential or datacenter, rotating or sticky) or scraper API>,
my timeout settings: <values>, waitUntil: <load / domcontentloaded / networkidle>,
requests in parallel: <number>.
Does the URL open in a normal browser on the same network? <yes/no>Dev details
Default timeouts, tool by tool
| tool | default | note |
|---|---|---|
| requests | none | waits forever unless you pass timeout |
| httpx | 5 s | per phase: connect, read, write, pool |
| aiohttp | 300 s total | connect to socket: 30 s |
| axios | none (timeout: 0) |
|
Node.js fetch (undici) |
connect 10 s | headers 300 s, body 300 s |
| curl | connect 300 s | whole transfer: never |
| Scrapy | 180 s (DOWNLOAD_TIMEOUT) |
timeouts retried, RETRY_TIMES = 2 |
Puppeteer page.goto |
30000 ms | waitUntil: 'load' |
Playwright page.goto (Python) |
30 s | wait_until="load" |
| W3C WebDriver page load | 300,000 ms | script timeout 30,000 ms |
Playwright’s Node.js docs now list no timeout by default for page.goto, unless your config’s navigationTimeout or setDefaultNavigationTimeout() sets one. The message always shows which limit fired.
What each library prints
Python requests (from the urllib3 and requests code):
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='example.com', port=443): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<…>, 'Connection to example.com timed out. (connect timeout=10)'))
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='example.com', port=443): Read timed out. (read timeout=10)
Max retries exceeded doesn’t mean requests tried again: its adapter’s default is 0 retries. It wraps the failure, so read what comes after Caused by.
httpx: httpx.ConnectTimeout, httpx.ReadTimeout, httpx.WriteTimeout, httpx.PoolTimeout. Catch all four using httpx.TimeoutException.
Browser errors:
page.goto: Timeout 30000ms exceeded.
=========================== logs ===========================
navigating to "https://www.nike.com/", waiting until "load"
============================================================
TimeoutError: Navigation timeout of 30000 ms exceeded (Puppeteer)
net::ERR_TIMED_OUT (Chromium -7: an operation timed out)
net::ERR_CONNECTION_TIMED_OUT (Chromium -118: a connection attempt timed out)
The logs block tells you what Playwright was still waiting for. In that log, the page kept loading tracking frames until the timer ran out.
curl (exit code 28, CURLE_OPERATION_TIMEDOUT):
curl: (28) Resolving timed out after <ms> milliseconds
curl: (28) Connection timed out after <ms> milliseconds
curl: (28) Operation timed out after <ms> milliseconds with 0 bytes received
Resolving = DNS never answered. Connection = no handshake. Operation … with 0 bytes received = connected, then nothing.
In Node.js:
timeout of 30000ms exceeded (axios, code ECONNABORTED, or ETIMEDOUT with transitional.clarifyTimeoutError)
Connect Timeout Error (undici / fetch, code UND_ERR_CONNECT_TIMEOUT)
Headers Timeout Error (undici / fetch, code UND_ERR_HEADERS_TIMEOUT)
Scrapy 2.20 raises scrapy.exceptions.DownloadTimeoutError: Getting https://… took longer than 180.0 seconds. Older versions raise Twisted’s TimeoutError, and it prints User timeout caused connection failure.
requests: connect and read are separate clocks
import requests
try:
r = requests.get("https://example.com/page", timeout=(3.05, 27))
except requests.exceptions.ConnectTimeout:
... # never connected: safe to retry
except requests.exceptions.ReadTimeout:
... # connected, no answer: the server may have done the work
The read timeout counts the wait between bytes, not the whole download. A page that trickles in can run well past 27 seconds. The docs say it plainly: neither timeout is wall clock time.
The docs suggest a connect timeout a bit above a multiple of 3, the default TCP retransmission window. Hence 3.05.
Playwright: catch the right TimeoutError
from playwright.sync_api import sync_playwright, TimeoutError as PlaywrightTimeoutError
with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()
try:
page.goto("https://example.com", wait_until="domcontentloaded", timeout=60_000)
page.wait_for_selector("h1")
except PlaywrightTimeoutError:
print("timed out")
browser.close()
Playwright’s TimeoutError is not Python’s built-in one. Import it under another name, as the docs do. Otherwise your except TimeoutError won’t catch it.
wait_until takes load (default), domcontentloaded, networkidle or commit. commit returns as soon as the response arrives and the page begins loading.
Playwright Test has its own clock: 30 seconds per test. You’ll see it as Test timeout of 30000ms exceeded. That one fires even when page.goto has no limit.
Puppeteer: networkidle waits for quiet
await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 });
await page.waitForSelector('h1');
networkidle0 waits for 0 open connections for 500 ms, networkidle2 for no more than 2. A page with live chat, analytics or polling may never get there. Change the default for a whole page with page.setDefaultNavigationTimeout().
curl: test the hops by hand
curl -v --connect-timeout 10 --max-time 60 -x http://user:pass@proxy.example:8000 https://example.com/
--connect-timeout limits only the connection phase. --max-time limits the whole transfer. With --retry <n>, curl treats a timeout as a transient error and retries it.
Proxy headers that name the timeout
RFC 9209 gives proxies a standard Proxy-Status header. Its timeout codes:
| value | means |
|---|---|
dns_timeout |
the proxy timed out looking up the site’s IP |
connection_timeout |
the proxy’s connection to the next hop timed out |
connection_read_timeout |
connected, but no new data came |
http_response_timeout |
the full response didn’t arrive within the proxy’s limit |
The RFC’s sample:
HTTP/1.1 504 Gateway Timeout
Proxy-Status: ExampleCDN; error=connection_timeout
Bright Data sends this header alongside its own codes:
| status | x-brd-err-code |
means | Proxy-Status error |
|---|---|---|---|
| 408 | peer_30040 |
Peer did not connect to destination due timeout | connection_timeout |
| 502 | target_40020, target_40021 |
Destination host connect timeout | connection_timeout |
| 499 | client_10140 |
your client closed the connection first | http_request_error |
Bright Data reads a 408 as “networking lags or blocks”, or an incorrect target URL.
Edge cases
- httpx’s 5 s default catches people moving from requests. A slow API that worked before now throws
ReadTimeout. - Scrapy per request: set
download_timeoutthroughRequest.meta. Third-party download handlers may ignore it. - aiohttp’s 300 s is total, for the whole operation. requests and httpx limits are per phase.
A browser timeout is never a status code. Playwright’s page.goto returns normally for any valid HTTP status, 404 and 500 included, and Puppeteer’s does the same in headless shell. It throws only when something breaks: a bad certificate, an invalid URL, a server that doesn’t answer, or the clock running out, so Timeout 30000ms exceeded means the wait condition you chose never came true in time. It doesn’t mean that the site sent an error.
The two Chromium codes divide the same way as connect and read. ERR_CONNECTION_TIMED_OUT (-118) is a connection attempt that timed out. ERR_TIMED_OUT (-7) is the general “an operation timed out”.
Proxy-Status is worth logging when it shows up. It names the proxy that failed and which step timed out, so you know which hop to fix.
Questions
Why does page.goto time out when the page already looks loaded?
By default page.goto waits for the load event, and a page full of trackers and ads can keep loading long after you see it. With Puppeteer's networkidle2, a page that keeps 2 or more long-running connections open never settles. Use waitUntil: 'domcontentloaded', then wait for the one element you need.
Does Python requests have a default timeout?
No. The requests docs say it does not time out unless you set a timeout, so a script can hang for minutes or more. Pass one on every call, for example timeout=(3.05, 27): 3.05 seconds to connect, 27 seconds of silence while reading.
Related
Tools that get past it
| Tool | Price |
|---|---|
| Free | |
| HTTPX: Python HTTP client with sync and async APIs and HTTP/2 support. | Free |
| Free | |
| Free | |
| Free | |
| Free |
Sources
Requests docs: Timeouts (connect, read, no default) requests.readthedocs.io
psf/requests source: exceptions.py (ConnectTimeout, ReadTimeout) github.com
psf/requests source: adapters.py (urllib3 timeout errors → requests errors) github.com
urllib3 source: connection.py ('Connection to … timed out') github.com
urllib3 source: connectionpool.py ('Read timed out') github.com
urllib3 source: exceptions.py ('Max retries exceeded with url') github.com- HTTPX docs: Timeouts python-httpx.org
- HTTPX docs: Exceptions (TimeoutException base class) python-httpx.org
- HTTPX docs: Resource Limits python-httpx.org
aiohttp docs: Client Quickstart (timeouts) docs.aiohttp.org
Playwright docs (Node.js): page.goto playwright.dev
Playwright docs (Python): page.goto playwright.dev
Playwright docs (Python): TimeoutError playwright.dev
Playwright docs: Timeouts (Playwright Test) playwright.dev
Playwright issue #12182: page.goto Timeout exceeded, no load event (log output) github.com
Puppeteer docs: Page.goto() pptr.dev
Puppeteer docs: WaitForOptions (timeout default 30000) pptr.dev
Puppeteer docs: PuppeteerLifeCycleEvent (networkidle0, networkidle2) pptr.dev
Puppeteer issue #9842: Navigation timeout of 30000ms exceeded github.com
Puppeteer issue #11247: TimeoutError: Navigation timeout of 30000 ms exceeded github.com
Chromium source: net_error_list.h (TIMED_OUT -7, CONNECTION_TIMED_OUT -118) github.com
libcurl docs: error codes (CURLE_OPERATION_TIMEDOUT 28) curl.se
curl man page: --connect-timeout, --max-time, --retry curl.se
libcurl docs: CURLOPT_CONNECTTIMEOUT (default 300 seconds) curl.se
libcurl docs: CURLOPT_TIMEOUT (default never) curl.se
curl source: multi.c (timeout messages) github.com
axios source: http adapter ('timeout of …ms exceeded') github.com
axios source: defaults (timeout 0) github.com
Node.js docs: fetch is based on undici nodejs.org
undici docs: Client (connect, headers, body timeouts) github.com
undici source: errors.js (UND_ERR_CONNECT_TIMEOUT) github.com
Scrapy docs: DOWNLOAD_TIMEOUT docs.scrapy.org
Scrapy 2.20.0 source: default_settings.py (RETRY_EXCEPTIONS, RETRY_TIMES) github.com
Scrapy 2.20.0 source: http11.py ('took longer than') github.com
Twisted source: error.py ('User timeout caused connection failure') github.com- W3C WebDriver: Timeouts (page load 300,000 ms) w3.org
RFC 9209: The Proxy-Status HTTP Response Header Field rfc-editor.org
Bright Data docs: Proxy errors troubleshooting docs.brightdata.com
Bright Data docs: Introduction to Residential proxies docs.brightdata.com
Oxylabs docs: Residential Proxies response codes developers.oxylabs.io
Oxylabs help center: Start using Dedicated ISP Proxies (504 about 60s) developers.oxylabs.io