Scripting Question

Find and click a button in an opened Internet Explorer.

06/05/2015 6563 views
As it sais in the title, IE is opened. I want to make a VBScript to click a button. Internet Explorer window is opened by the other part of the VBs. My other VBs will open an URL then it will press a button that everytime will open a new IE with a random URL and this part I want to press a button on that new IE.

The button ID is: id="pagesHeaderLikeButton"
Answer Summary:
0 Comments   [ + ] Show comments


Answer Chosen by the Author

Well... I found the answer.

For Each wnd In CreateObject("Shell.Application").Windows
        If InStr(wnd.Name,"Internet") Then
            if InStr(wnd.Document.URL,"facebook.com") Then
                Set IE2 = wnd
                Exit For
            End If
        End If
    Set Butlike = IE2.Document.getElementsByTagName("button")
    For Each btn In Butlike
    If btn.type = "submit" Then btn.Click()
Answered 06/09/2015 by: XmasterOfficial
White Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ