A Python script to scrapes accomandation information from Booking.com search results using Selenium and BeautifulSoup. Usefull to create bulk email-lists (see repo; Email_Scraper)
- Python 3.x
- Selenium
- BeautifulSoup4
- pandas
- colorama
- webdriver-manager
-
Clone this repository:
git clone https://github.com/yourusername/booking-hotel-scraper.git cd booking-hotel-scraper -
Install the required packages:
pip install -r requirements.txt
-
Start the script:
python booking_scraper.py
-
Follow the on-screen instructions:
- Enter the Booking.com search results URL when prompted.
- Enter the maximum number of hotels to scrape.
-
The script will:
- Open the provided URL in a Chrome browser using Selenium.
- Scroll down the page to load all hotel results.
- Scrape hotel names and other details.
- Handle retries and cooldowns for loading more results.
- Save the scraped data to an Excel file named
hotels.xlsx.
- Ensure that the Booking.com URL provided returns a list of hotel search results.
- The script will handle scrolling and loading more results automatically.
- The script includes retry and cooldown mechanisms to handle potential scraping issues.
- Use this project ethically and legally.
- Respect the website's terms of service.
- Excessive scraping can lead to your IP being blocked by the website.
This project is licensed under the MIT License.