My selenium python script can't click the button with either click()
or `driver.execute_script("arguments[0].click();", continue_). It worked for previous buttons but this particular button is only detected but can't be clicked.
Here is the code:
WebDriverWait(driver, 60).until(EC.presence_of_element_located(
(By.XPATH, "//button[contains(text(),'Continue')]")))
continue_ = driver.find_element(
By.XPATH, "//button[contains(text(),'Continue')]")
driver.execute_script("arguments[0].click();", continue_)
Update: The answers didn't work for me. I tried adding prints to see where it stops.
WebDriverWait(driver, 60).until(EC.presence_of_element_located(
(By.XPATH, "//button[contains(text(),'Continue')]")))
print("Presence Located")
continue_ = driver.find_element(
By.XPATH, "//button[contains(text(),'Continue')]")
print("Continue Button Found")
driver.execute_script("arguments[0].click();", continue_)
print("Continue Button Clicked")
My console displays all prints till the "Continue Button Clicked" but is still not clicking the Continue so my bot can't progress through it's script. I don't know if it's any help but can't think of anything else.
Update Tried using is_displayed() on the continue button it returned True.