from time import sleep from selenium import webdriver from selenium.webdriver import common from selenium.webdriver.support import ui, expected_conditions if __name__ == "__main__": opts = webdriver.FirefoxOptions() # opts.add_argument("-headless") webd = webdriver.Firefox(options=opts) webd.get("https://hplanning2022.umons.ac.be") horaires = ui.WebDriverWait(webd, 3).until(expected_conditions.presence_of_element_located((common.by.By.XPATH, "/html/body/div[1]/div[3]/div[3]/div[2]/div[1]/div/ul/li[4]/b/a/div"))) horaires.click() cours = ui.WebDriverWait(webd, 3).until(expected_conditions.presence_of_element_located((common.by.By.XPATH, '//*[@id="GInterface.Instances[1].Instances[1].bouton_Edit"]'))) cours.click()