Hotel Reviews Scraper is a simple to use web scraper that can scrape hotel reviews from TripAdvisor.
Use the package manager pip to install foobar.
pip install selenium, beautifulsoup4, webdriver-manager, pandas
First run the code to setup the Selenium's chrome driver.
service = Service(ChromeDriverManager().install())
driver = webdriver.Chrome(service=service)
url = 'https://www.tripadvisor.in'
driver.get(url)
Then run the function start_scraping().
start_scraping()
Now it will ask for how many hotels to show in the options list
Finally, it will ask for the hotel name to search for
For demonstration, let us search for "Marriott"
This is how the output is going to look like:
After selecting any of the options, the scraper will start to scrape reviews of that hotel and save it as a csv file (in the same directory as the scraper.ipynb file) with the name that u searched for intially.
In our case the name would be: "Marriott.csv"