Sumutiu Marius
Sumutiu Marius

Reputation: 491

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

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.

Upvotes: 0

Views: 3194

Answers (1)

Sumutiu Marius
Sumutiu Marius

Reputation: 491

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

Upvotes: 1

Related Questions