I am learning selenum with python and the explicit wait method doesn't work to click on the 'accept cookies' button. Otherwise, the time.sleep method work and I would like to understant why the explicit wait method doersn't work. I typed this code : (sorry for my bad english, I'm french...)
driver.get("https://demo.guru99.com/test/newtours/")
driver.maximize_window()
WebDriverWait(driver, 30).until(EC.frame_to_be_available_and_switch_to_it((By.ID, "gdpr-consent-notice")))
WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="save"]/span[1]/div/span'))).click()
WebDriverWait(driver, 30).until(EC.frame_to_be_available_and_switch_to_it((By.ID, "gdpr-consent-notice")))
time.sleep(1)