The element Alles akzeptieren is within #shadow-root (open).
Solution
To click on Alles akzeptieren you have to use shadowRoot.querySelector()
and you can use the following Locator Strategy:
-
Code Block:
driver.get("https://www.heise.de/download/") time.sleep(5) element = driver.execute_script("""return document.querySelector('#usercentrics-root').shadowRoot.querySelector('footer div div div button[data-testid="uc-accept-all-button"]')""") element.click()
-
Browser Snapshot:
References
You can find a couple of relevant discussions in: