I am trying to click on 'Alles accepteren' (in english: Accept all) in the cookie pop-up but nothing seems to work. It probably has to do with focusing on the right window. Any help would be appreciated.
My code:
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
driver = webdriver.Chrome(executable_path="path to chromedriver.exe")
driver.maximize_window()
driver.get("https://www.hornbach.nl/")
wait = WebDriverWait(driver,30)
wait.until(EC.frame_to_be_available_and_switch_to_it((By.XPATH,"//iframe[@title='??']")))
cookie = wait.until(EC.element_to_be_clickable((By.XPATH,"//button[text()='Alles accepteren']")))