Unable to click the linktext using selenium execute_script
function
This is what I am tring to do:
self.driver.execute_script("document.getElementByLinktext('Level 1s').click;")
You are not calling the click()
method:
self.driver.execute_script("document.getElementByLinktext('Level 1s').click();")
FIX HERE^
Note that you can also locate the element with selenium and then pass it into the script:
link = self.driver.find_element_by_link_text('Level 1s')
self.driver.execute_script("arguments[0].click();", link)
You can also perform the click via selenium directly if applicable:
link.click()
Also related: