Access shadow root content with selenium
Access shadow root content with selenium Question: I’m trying to accept the cookie pop up on http://www.immobilienscout24.de. I’m using selenium 4.61, webdriver-manger with chrome, python 3.11 and Fedora 37, but I’m always getting an error. I’m using the following code driver = webdriver.Chrome(ChromeDriverManager().install()) def accept_cookies(): shadow_root = WebDriverWait(driver, 2).until(EC.presence_of_element_located((By.CSS_SELECTOR, "#usercentrics-root"))).shadow_root shadow_root.find_element((By.CLASS_NAME, "sc-gsDKAQ fWOgSr")).click() url = …