Issue
I have the following three buttons that I can't figure out how to grab the text that is inside of them (e.g Outliers). I tried browser.find_element_by_link_text("Outliers").click()
, but got "Unable to locate element" error. How can I do it?
Solution
See: find_element_by_* commands are deprecated in selenium
In newer versions of selenium try:
from selenium.webdriver.common.by import By
browser.find_element(By.XPATH, '//button[text()="Outliers"]')
older versions of selenium:
browser.find_element_by_xpath('//button[text()="Outliers"]')
To update ALL of the older versions I found a nifty regex here, and then just fixup the import:
Answered By - jmunsch
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.