Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98814

Python Selenium: accessing aria-label information

$
0
0

I am trying to read the reviews related to app present on google play store. I am using Selenium for this purpose. Each review present in jscontroller ="H6e0Ge".

enter image description here

Inside jscontroller = "H6e0Ge" tag, I am trying to retrieve the rating given by the user is associated by the "aria-label", as shown in the picture.

enter image description here

To read rating of all reviewers, my code is

driver = webdriver.Chrome('/Users/yasirmuhammad/Downloads/chromedriver')
driver.get('https://play.google.com/store/apps/details?id=com.axis.drawingdesk.v3&hl=en&showAllReviews=true')
for a in driver.find_elements_by_xpath("//*[@class='d15Mdf bAhLNe']"):
    print(a.find_element_by_class_name('X43Kjb').text)
    print(a.find_element_by_class_name('p2TkOb').text)
    print(a.find_element_by_xpath('/html/body/div[1]/div[4]/c-wiz/div/div[2]/div/div[1]/div/div/div[1]/div[2]/div/div[2]/div/div[2]/div[1]/div[1]/div/span[1]/div/div').get_attribute('aria-label'))

Third print statement reads the rating, but the problem is it remain same for all users. The reason is because I copied the full xpath of rating of first user, hence it shows the same rating for other users. So I replace the third statement with below statement:

print(a.find_element_by_class_name('pf5lIe').get_attribute('aria-label'))

However, this statement returns "None". Could anyone guide me how should I read the "aria-label" related information?


Viewing all articles
Browse latest Browse all 98814

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>