Guide
How to Scrape Booking.com Hotel Data
Learn how to scrape Booking.com for hotel prices, reviews, availability, and amenities. Complete Python guide with code examples.
Booking.com is the world's largest accommodation platform. Scraping it enables hotel price comparison, travel analytics, and competitive intelligence for the hospitality industry.
Valuable Data Points
| Data Point | Use Case |
|---|---|
| Hotel prices | Price comparison and monitoring |
| Guest reviews | Sentiment analysis |
| Availability | Demand forecasting |
| Amenities | Feature comparison |
| Location data | Geographic analysis |
| Star ratings | Quality benchmarking |
The Challenge
Booking.com has strong anti-scraping measures:
- Dynamic pricing loaded via JavaScript
- CAPTCHA challenges
- IP-based rate limiting
- Session-based content variation
Recommended: Use ScraperAPI
ScraperAPI handles Booking.com's anti-bot measures, including JavaScript rendering and CAPTCHA bypass.
import requests
from bs4 import BeautifulSoup
API_KEY = "YOUR_SCRAPERAPI_KEY"
url = "https://www.booking.com/searchresults.html?ss=New+York&checkin=2026-06-01&checkout=2026-06-05"
resp = requests.get(
f"http://api.scraperapi.com?api_key={API_KEY}&url={url}&render=true"
)
soup = BeautifulSoup(resp.text, "html.parser")
Extracting Hotel Data
hotels = soup.select("[data-testid='property-card']")
for hotel in hotels:
name = hotel.select_one("[data-testid='title']")
price = hotel.select_one("[data-testid='price-and-discounted-price']")
score = hotel.select_one("[data-testid='review-score']")
print(f"Hotel: {name.text.strip() if name else 'N/A'}")
print(f"Price: {price.text.strip() if price else 'N/A'}")
print(f"Score: {score.text.strip() if score else 'N/A'}")
Tips for Better Results
- Set specific dates, Prices only show with check-in and check-out dates
- Vary search parameters, Prices change by currency, guest count, and filters
- Monitor over time, Hotel prices fluctuate daily
- Use ScrapingAnt as backup, Switch providers if one gets blocked
- Parse the JSON data, Booking.com embeds structured data in script tags
Handling Pagination
Booking.com uses offset-based pagination with the offset parameter, typically in increments of 25.
for offset in range(0, 100, 25):
url = f"https://www.booking.com/searchresults.html?ss=Paris&offset={offset}"
# Fetch and parse each page
Legal Considerations
Booking.com's Terms of Service restrict automated scraping. Use data for personal analysis only and avoid commercial redistribution without proper licensing.