Python Selenium return text, unicode object is not callable -
i'm trying use selenium automate web browsing. i'm trying access specific element class name , return text within (the element im selecting on page definetly has text in it) , when try return in function get
typeerror: 'unicode' object not callable
my code function follows:
driver = webdriver.chrome("my chromedriver installation path") driver.get("website url") def gettext(): return driver.find_element_by_class_name("class text").text() print gettext()
.text
not method, attribute:
driver.find_element_by_class_name("class text").text
Comments
Post a Comment