You are browsing a tutorial guide for the latest Octoparse version. If you are running an older version of Octoparse, we strongly recommend you upgrade because it is faster, easier and more robust! Download and upgrade here if you haven't already done so!
Booking is one of the largest online hotel booking websites. This tutorial will show you how to scrape reviews of hotels from Booking with Octoparse.
To follow through, here is the example URL:
The main steps are shown in the menu on the right and you can download the sample task file here.
1. Create a Go to Web Page - to open the target website
Enter the target URL on the homepage of Octoparse and click Start
2. Extract Data - to scrape the basic information of the hotel
3. Click "Read all reviews" - to show all reviews
Click Read all reviews in the Guest reviews area
Choose the Click element on the Tips
Paste the updated XPath //span[contains(text(),"Read all reviews")] for Click Item >Click Apply
Set up Load with AJAX 4s for the Click Item
4. Scrape general ratings for the hotel - to scrape the category ratings
5. Set up a loop for detailed reviews - to scrape reviews from guests
6. Set up Pagination Loop - to scrape data from multiple listing pages
Click on the Pagination box
Input Xpath //a[@class="pagenext"]
Click Apply
Set up AJAX Load as 10s for the Click to Paginate
The final workflow should look like this:
7. Run the task - to get your target data
Click Run to run your task either on your device or in the cloud
Select Standard Mode under Run on your device to run the task on your local device
Waiting for the task to complete
Here is the sample output data, which can be exported in Excel, CSV, HTML and JSON formats.