This project demonstrates how to use Bright Data's Scraping Browser with Playwright to search for hotels on Booking.com. It provides a practical example of web scraping with automated browser control using Playwright.
Open in CodeSandbox, sign in with GitHub account, then fork the repository to begin making changes.
- Replace
YOUR_BRIGHT_DATA_SCRAPING_BROWSER_ENDPOINTwith your actual Bright Data scraping browser webSocket endpoint inbooking-hotel-scraping.js - Run
node booking-hotel-scraping.jsto start scraping
-
Modify search parameters in
booking-hotel-scraping.js:const SEARCH_LOCATION = "New York"; // Change to your desired location const CHECK_IN_DAYS_FROM_NOW = 1; // Adjust check-in date const CHECK_OUT_DAYS_FROM_NOW = 2; // Adjust check-out date
-
Run the script:
node booking-hotel-scraping.js
📊 Search Results:
==================
┌─────────┬─────┬────────────────────┬──────────┬─────────┐
│ (index) │ # │ Hotel Name │ Price │ Rating │
├─────────┼─────┼────────────────────┼──────────┼─────────┤
│ 0 │ 1 │ Hotel Name 1 │ $100 │ 8.5 │
│ 1 │ 2 │ Hotel Name 2 │ $150 │ 9.0 │
│ 2 │ 3 │ Hotel Name 3 │ $200 │ 8.8 │
└─────────┴─────┴────────────────────┴──────────┴─────────┘