/build/static/layout/Breadcrumb_cap_w.png

Press a button inside an already opened IE

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:
id="pagesHeaderLikeButton"
So what I really want. My VBScript opens that page, then it will press that button and then I want to press that
id="pagesHeaderLikeButton"

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
Loop
    Set Popupbutton = IE.Document.GetElementsByClassName("btn3")
    for each button in Popupbutton
       button.click
       WScript.Sleep 5000
    exit for
    objWindow.Quit
    WScript.Sleep 5000
next
Loop

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
  </div>
</a>

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
  </div>
</a>

0 Comments   [ + ] Show comments

Answers (1)

Posted by: anonymous_9363 8 years ago
Red Belt
0
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.

Comments:
  • 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. - XmasterOfficial 8 years ago
 
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