Siddharthan Asokan
Siddharthan Asokan

Reputation: 4441

Finding a specific text in a page using selenium python

I'm trying to find a specific text from a page https://play.google.com/store/apps/details?id=org.codein.filemanager&hl=en using selenium python. I'm looking for the element name - current version from the above url. I used the below code

 browser = webdriver.Firefox() # Get local session of firefox
 browser.get(sampleURL) # Load page

 elem = browser.find_elements_by_clsss_name("Current Version") # Find the query box
 print elem;
 time.sleep(2) # Let the page load, will be added to the API
 browser.close()

I don't seem to get the output printed. Am I doing anything wrong here?

Upvotes: 0

Views: 1315

Answers (1)

Ander2
Ander2

Reputation: 5658

There is no class with name "Current Version". If you want to capture the version number that is below the "Current Version" text, the you can use this xpath expression:

browser.find_element_by_xpath("//div[@itemprop='softwareVersion']")

Upvotes: 1

Related Questions