How do I access and click on a button which hyperlinks to a javascript function?
html element:
<a href="javascript:Nav('-index=')" id="ctl04_ctl25_ctl00_lnk2NextPg" class="twPagerBtn right" role="button" onclick="mySpud.container.scrollIntoView();" title="Next Page" aria-label="Next Page">►</a>
My current code:
next_button='//*[@id="ctl04_ctl06_ctl00_lnk2NextPg"]'
try:
element=WebDriverWait(driver,15).until(
EC.presence_of_element_located((By.XPATH,next_button))
)
element.click()
except:
driver.quit()
Selenium is unable to find the element and I've also tried using the find_element() function using various methods (by id etc) to no avail.