How to deal with shadow dom/roots [selenium]

How to access elements which are within ‘shadow roots’ and interact with them?

an example of this is present in “chrome://settings/” under the element (selector) “body > settings-ui”

1 Like

I have the same problem

Well i did it using python (not ipy through ob2) @mazza005

Did you manage to solve it? If yes, how did you do it?

This contains a javascript example which u should be able to use in openbullet aswell with seleniumExecuteJs:

return document.querySelector('settings-ui').shadowRoot.querySelector('settings-main').shadowRoot.querySelector('settings-basic-page').shadowRoot.querySelector('settings-section > settings-privacy-page').shadowRoot.querySelector('settings-clear-browsing-data-dialog').shadowRoot.querySelector('#clearBrowsingDataDialog').querySelector('#clearBrowsingDataConfirm')

(change it for your site)
1 Like

How did you solve it?

I told you earlier, using a python script, it has nothing to do with ob2, i just coded my whole program on python.

You can google the rest.

is there any way to do in OB2??