How to click a role button

I try to use javascript to click here, but I can not find the solution for it,
the link respond to mouse left click and number 1 of the keypad
I do not have access to the site, I cannot change it

<div class="profile-action profile-action--lg profile-action--color-yes profile-action--filled js-profile-header-vote-yes js-profile-header-vote" data-choice="yes" role="button">  

</div>

Regards,

If you don’t have access to the site, where are you proposing to put your JavaScript?

1 Like

inspect / console

You can use document.querySelector("div[role=button]") to access that element.

For example:

const voteYesButton = document.querySelector("div[role=button]");
for (i = 0; i < 10000; i += 1) {
    voteYesButton.click();
}
2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.