I'm looking to access to the button but the CLOSED shadow DOM block me, how can i switch it to open and have access to this button ?
<div class="button-holder help-button-holder">
#shadow-root (closed)
<link rel="stylesheet" href="chrome-extension://mpbjkejclgfgadiemmefgebjfooflfhl/src/solve/solver-button.css">
<button tabindex="0" title="Solve the challenge" id="solver-button"></button>
</div>
I have encounter the same problem and manager to work around it.
So the idea is to focus on the closest element before "shadow-root (closed)", then use Tab key to reach that solver button, then click it.
I work on Kotlin, but you should be able to attempt for python.
// click to focus on the solver button wrapper
driver.findElement(By.cssSelector(".button-holder.help-button-holder")).click()
// use Actions instead of pointing to the solver button itself
val actions = Actions(driver)
actions.sendKeys(Keys.TAB)
actions.click()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With