BenjaminHa
BenjaminHa

Reputation: 11

How to get Button element inside several shadow roots of html page by using JS?

I need to get the button to click on "Claim 1" button on https://bioniq.io/launch/goated-gamer/free-claim using Javascript.

I want to get the Claim button in below screen but the button is hidden hin shadow root of the page

Here the screenshot

I tried to use below script to access Claim button but I cannot

document.querySelector('bioniq-app').shadowRoot.querySelector('bioniq-launch-sale-main-page').shadowRoot.querySelector('bioniq-launch-sale-header').shadowRoot.querySelector('bioniq-launch-sale-group').querySelector('bioniq-launch-price-option:nth-child(1)').shadowRoot.querySelector('toniq-button').shadowRoot.querySelector('button').click();

But it cannot run and return the error. Could you please help to review and advise? Thank you.

Upvotes: 0

Views: 57

Answers (0)

Related Questions