Shadow Root
Solution for “Shadow-root” elements, for example some “accept cookies” pages:
To treat these elements we need to use the executeJavascript function, for example:
Document.getElementById(“usercentrics-root”).shadowRoot.querySelector(“[data-testid=uc-accept-all-button]”).click();
The steps to follow are the following:
-
Find the element that includes shadow-root (document.getElementById(“usercentrics-root”))
-
Navigate to shadow-root (.shadowRoot)
-
Navigate to the element with querySelector (.querySelector(“[data-testid=uc-accept-all-button]”))
-
Interact with the element (.click())
No Comments