How to click a plain button on a webpage using VBScript?

3.1k views Asked by At

I have a button on an website like this

<button>
Like
</button>

Does anyone know how to find and click this button using VBScript? Since he have no ID or other things I don't know how to find the button.

1

There are 1 answers

0
Sumutiu Marius On BEST ANSWER

So it seems that I am answering my own questions. The more you search, the fastest you learn.

Set Butlike = IE.Document.getElementsByTagName("button")
if btn.textContent= "Like" then
    btn.Click()
End if