Reputation: 792
I'm trying to use Selenium to automate some web browsing. Currently I'm trying to access a specific element by class name and return the text within it (the element im selecting on the page definetly has text in it) and when I try to return it in my function I get
TypeError: 'unicode' object is not callable
My code for the function is as follows:
driver = webdriver.Chrome("my chromedriver installation path")
driver.get("website URL")
def getText():
return driver.find_element_by_class_name("class with text").text()
print getText()
Upvotes: 5
Views: 4925