Scripting Question

Press a button inside an already opened IE

06/07/2015 3191 views
Hello. I have a script that opens an website then it clicks a button. That button opens a new Internet Explorer with a random URL. Every new Internet Explorer will have a button called:
So what I really want. My VBScript opens that page, then it will press that button and then I want to press that

in that new Internet Explorer.

This is my script so far:

Set IE = createobject("internetexplorer.application") 
strURL = "website"

Do While True
IE.navigate strURL 
IE.Visible = true   
Do While (IE.Busy Or IE.READYSTATE <> 4)    
    WScript.Sleep 1000
    Set Popupbutton = IE.Document.GetElementsByClassName("btn3")
    for each button in Popupbutton
       WScript.Sleep 5000
    exit for
    WScript.Sleep 5000

The above script will press the button: "btn3" and that button will open a new IE window where there is the button "pagesHeaderLikeButton"

Note that the button is a div type button.

This is the button that my VBscript will press:

<a href="random url">
  <div class="btn3">
    Music I Like

This will open a new IE window in which there is this button I want to press:

<a href="Music.html">
  <div id="pagesHeaderLikeButton">
    Music I Realy Like
0 Comments   [ + ] Show comments


All Answers

It must be easier to work out how the data is being POSTed by the button and then build a string containing that data and sending that to the browser.
Answered 06/10/2015 by: anonymous_9363
Red Belt

  • Yes but this script is part of an IE automation script and the website have antibot. And that's why I need to simulate the human behaviour.

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