Selenium python sometimes not click the button

Viewed 29

I created a loop that clicks some buttons while I'm away from the computer, but every time I go back, I see that the loop has stopped, and I don't understand why I can still click the button:

loop = True
while loop:
    try:
        driver.find_element(By.XPATH, '//*[@id="scheduleForm:dataTableListaAtos:0:bCal"]').click()
        WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="scheduleForm:j_idt174"]'))).click()
        driver.find_element(By.XPATH, '//*[@id="j_idt277"]').click()
    except:
        continue
0 Answers
Related