I am using selenium to scrape reviews from tripadvisor.com. I haven't found the right way to extract all the review rating made by users:"ui_bubble_rating bubble_50", 50 = 5 star.
<span class="ui_bubble_rating bubble_50"></span>
::before==$0
::after==$0
Is there any way to extract the number using selenium? Anyone knows, please help to point out with many thanks.
I tried the code below, but the xpath can't find the value I need. It provided only one star rating which is same for all review.
var = driver.find_element_by_xpath("//span[contains(@class, 'ui_bubble_rating bubble_')]").get_attribute("class")
I need the star rating of each review, please have a look at the photo below for what I need. Thank you
Hi. I finally solved my problem. Thank you so much for your time. I just put the answer here in case someone needs.
var = driver.find_element_by_class_name('ui_bubble_rating').get_attribute('class')
review_rating = var.split("_")[-1]