How to fix Python requests ReadTimeout error?

by scrapecrow Dec 19, 2022

ReadTimeout error is seen when using Python requests module for web scraping with explicit timeout parameter:

import requests
response = requests.get("https://httpbin.dev/delay/2", timeout=1.5)  # 1.5 seconds
# will raise
# ReadTimeout: HTTPConnectionPool(host='httpbin.dev', port=80): Read timed out. (read timeout=2)

The ReadTimeout exception means that the request could not be completed in the given time frame. By default, the requests module has no timeout which can hang the whole program indefinitely so this value should always be set to 1-120 seconds depending on the target.

If you're encountering a lot of ReadTimeout exceptions your scraper might be being blocked by the website. For more on that see our guide how to scrape without getting blocked

See related errors: ConnectTimeout

Related Articles

Guide to Python requests POST method

Discover how to use Python's requests library for POST requests, including JSON, form data, and file uploads, along with response handling tips.

PYTHON
REQUESTS
HTTP
Guide to Python requests POST method

Guide to Python Requests Headers

Our guide to request headers for Python requests library. How to configure and what do they mean.

PYTHON
REQUESTS
HTTP
Guide to Python Requests Headers

How to Scrape YouTube in 2025

Learn how to scrape YouTube, channel, video, and comment data using Python directly in JSON.

SCRAPEGUIDE
PYTHON
HIDDEN-API
How to Scrape YouTube in 2025

Guide to List Crawling: Everything You Need to Know

In-depth look at list crawling - how to extract valuable data from list-formatted content like tables, listicles and paginated pages.

CRAWLING
BEAUTIFULSOUP
PYTHON
Guide to List Crawling: Everything You Need to Know

How to Find All URLs on a Domain

Learn how to efficiently find all URLs on a domain using Python and web crawling. Guide on how to crawl entire domain to collect all website data

CRAWLING
PYTHON
How to Find All URLs on a Domain

How to Capture and Convert a Screenshot to PDF

Quick guide on how to effectively capture web screenshots as PDF documents

SCREENSHOTS
PYTHON
NODEJS
How to Capture and Convert a Screenshot to PDF