0

I'm trying to access the "solver-button." So I looked into shadow roots, and it appears I have to open it. I tried doing this by getting the xpath of the "help-button-holder," which didn't work? It just returns it as null, and I'm not sure why as I've accessed other things the same way earlier in the script? I just need to click on "solver-button," I'm really not sure why it isn't working. I've tried,

driver.find_element_by_css_selector('.button-holder.help-button-holder'),  
driver.find_element_by_css_selector('help-button-holder'),   
driver.find_element_by_class_name('solver-button')

etc,

It feels like there are no other solutions as none of them work. Any help is appreciated.

ScreenShot

Mikel
  • 1
  • 1
  • Shadow-DOM is closed – YaDav MaNish Aug 02 '21 at 02:18
  • I know, thats why I was trying to open it. However, when I try to access the "help-button-holder," it returns THAT as null. – Mikel Aug 02 '21 at 02:21
  • well you can't open/access the closed Shadow-DOM as much I know- It's like an encapsulation – YaDav MaNish Aug 02 '21 at 02:22
  • I watched a tutorial on it. I just have to access the thing above it first, which I can't do because for whatever reason trying to find it by class name, xpath, etc doesn't work. – Mikel Aug 02 '21 at 02:24
  • Someone has asked this before for your page. Have a look at this: https://stackoverflow.com/questions/67141915/how-click-on-a-button-under-a-closed-shadow-dom-with-selenium-for-python – RichEdwards Aug 02 '21 at 08:31
  • I tried that solution, it errored and said it couldn't find the help button holder, even though it exists, I can see it in inspect element. – Mikel Aug 02 '21 at 17:39
  • @RichEdwards ^ If you didn't see this. – Mikel Aug 02 '21 at 19:45
  • Are you able to share a link to your web page? - you might need to synchronise in the shadow parent being available before you select it – RichEdwards Aug 03 '21 at 08:01
  • It's kind of awkward to access. I just wanna know why I can't find the element that ISN'T in the shadow root. I need to find it in order to open the shadow root, but I can't do that for some reason. – Mikel Aug 03 '21 at 19:20
  • @RichEdwards ^^^ – Mikel Aug 05 '21 at 01:15

0 Answers0