Reputation: 34
I'm trying to find text on the page. Python code using Selenium:
driver.find_element_by_xpath("//span[@ng-bind=''@' + user.username']")
The text I need "@bassale" is on the page:
When executing the code, I get an error:
selenium.common.exceptions.InvalidSelectorException: Message: {"errorMessage":"Unable to locate an element with the xpath expression //span[@ng-bind=''@' + user.username'] because of the following error:\nError: INVALID_EXPRESSION_ERR: DOM XPath Exception 51
Help me find this text on the page.
Upvotes: 2
Views: 768
Reputation: 165
Try with something like this:
driver.find_element_by_xpath("//span[@ng-bind=\"'@' + user.username\"]")
Upvotes: 2