Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98807

How do I get an element from shadow DOM in Selenium in Python?

$
0
0

could someone please explain to me how to get an element from shadow DOM in Selenium4 in Python? I want to element.click() to Accept the cookies - but I fail at the very first step!

I've tried driver.find_element(By.CSS_SELECTOR, '#shadow_host')... driver.find_element(By.CSS_SELECTOR, '#shadow_root')

Every time "no such element: Unable to locate element".

Bye

Michael

enter image description here


Viewing all articles
Browse latest Browse all 98807


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>