This repository contains two powerful web scrapers for extracting hotel data from Google Hotels using the Crawlbase Crawling API:
-
🔍 Hotel Listings Scraper – Collect hotel names, prices, ratings, and links from search results.
-
🏷️ Hotel Detail Page Scraper – Visit each hotel’s page to extract detailed info like address, contact, and more.
📖 Read the full tutorial → How to Scrape Google Hotels with Python
-
crawlbase– to access Crawlbase Crawling API -
BeautifulSoup– for HTML parsing -
json– for structured data storage -
Python 3.6+
Install the required dependencies:
pip install crawlbase beautifulsoup4File: google_hotels_listings_scraper.py
- Scrapes hotel listings from Google Hotels for a given location.
- Supports pagination by simulating clicks on the “Next” button.
- Saves the scraped data to
google_hotels.json.
- Replace
CRAWLBASE_JS_TOKENwith your Crawlbase token. - Run the script:
python google_hotels_listings_scraper.py[
{
"name": "The Plaza Hotel",
"price": "$784",
"rating": "4.6",
"link": "https://www.google.com/travel/hotels/..."
},
...
]File: google_hotel_details_scraper.py
-
Takes individual hotel URLs and scrapes additional details such as:
- Address
- Contact Info
- Number of Reviews
- Hotel Type
-
Saves the results to
google_hotel_details.json.
- Replace
CRAWLBASE_JS_TOKENwith your Crawlbase token. - Add a list of hotel URLs (you can reuse results from the listings scraper).
- Run the script:
python google_hotel_details_scraper.py[
{
"name": "The Plaza Hotel",
"price": "$784",
"rating": "4.6",
"no_of_reviews": "1,234 reviews",
"hotel_type": "5-star hotel",
"address": "768 5th Ave, New York, NY 10019",
"contact": "+1 212-759-3000",
"link": "https://www.google.com/travel/hotels/..."
},
...
]- Increase max_pages in the listings scraper to collect more data.
- Use output from listings as input to the detail scraper.
- Combine both scripts into a pipeline for full automation.