/bundles/itninjaweb/img/Breadcrumb_cap_w.png
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   [ - ] Hide Comments

Comments

Please log in to comment

Answer this question or Comment on this question for clarity

Answers

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.
Answered 06/10/2015 by: VBScab
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.
Please log in to comment
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share