My script should open a page and click the consent button on the occuring popup. My code:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
import time
s=Service(ChromeDriverManager().install())
driver = webdriver.Chrome(service=s)
driver.maximize_window()
def webde_reg():
driver.get('https://web.de/consent-management')
time.sleep(5)
consent_button = driver.find_element(By.ID, "save-all-conditionally")
consent_button.click()
time.sleep(2)
webde_reg()
Sadly, no matter if i try it via xpath or id the element cant be found. Is it because it is a popup and wont be recognized? how to resolve?
