Hi
I am brand new to Python - please and thanks in advance for your patience.
I have a site of customer reviews where I want to pull out the number of stars out of 5 that a reviewer gave a provider
In the below example, the reviewer has given the provider 1 star out of 5. I want to be able to pull the "1" from the <meta itemprop="ratingValue" content="1"> below
<div class="rvw__hdr">
<meta itemprop="worstRating" content="1">
<meta itemprop="ratingValue" content="1">
<meta itemprop="bestRating" content="5">
</div>
</div>
I have spent hours on this.
The nearest I have is the following:
rating = driver.find_elements_by_xpath('//div[@class="rvw__hdr-stat"]')
num_page_items = len(rating)
for i in range(num_page_items):
This returns emptiness
when I omit the.text, I get objects returned for each of the 30 reviews on the page, one of which is as follows:
<selenium.webdriver.firefox.webelement.FirefoxWebElement (session="271fc297-c03f-42b2-a680-2b5dd5656227", element="e1066956-81f4-4203-a2ae-5d3cdd95789a")>
I am clueless as to how to turn this into what I want, the actual rating number provided by the reviewer
I have tried other variations of driver.find_elements_by_.... with no luck
Thanks in advance for any help