Andy Pham
Andy Pham

Reputation: 19

Using Selenium to get the information within title= ' '

please help me to find the solution to get the information from this html code by using Selenium without XPath because I want to make a loop from it.

I want to get the result as: "4.7" from this "title="4.7/5 - 10378 Reviews"

please check the picture below:

enter image description here

Upvotes: 0

Views: 85

Answers (1)

Sajid
Sajid

Reputation: 308

If you have driver setup already,

Than try something like this,

rating = driver.find_element_by_class_name("stars").get_attribute("title")

print (rating)



Upvotes: 1

Related Questions