I want to pass a captcha on website https://sirus.one/#play and I need to set the solved captcha value in textarea.g-recaptcha-response -> div.innerText. TextArea has shadowRoot where website saving the response of recaptcha.
I tried to access shadowRoot like that:
document.querySelector("textarea.g-recaptcha-response").shadowRoot
, but the result is null.
If I print the element in console it appears that shadowRoot exists
How to get the shadowRoot?
2
Answers
It was my mistake. I can't access shadowRoot created by browser. The solution is just to change the value of textarea:
document.querySelector("#g-recaptcha-response").value = "123"
Since it is a captcha you are trying to solve I think it’s a reasonable assumption that the shadow root has not been attached with the
mode: open
option. As such you will not be able to access it using the shadowRoot property