Selenium how to simply grab an html value in Python

While dealing with Selenium, you may run into object that have no ID and no Name, or a duplicate name.  At this point the unique identifier might be the Value field.  While normally Xpath values are a pain to deal with, you can simply wild card them if the Value field is indeed unique to the page.

elem = driver.find_element_by_xpath(".//*[@value='<WhatIamLookingFor>']")
elem.click()

Comments

Popular posts from this blog

Policy Based Routing on a Nexus

Cloudflare Calls API to SIP broker