WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with MSIE
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Find a Link in a Webpage then Click on it


Winbatch Version: 2005C -- Script By Jay Alverson

;   Winbatch 2005C, MSIE 6...

#DefineFunction startMSIE(url)
   msie = ObjectCreate("InternetExplorer.Application")
   msie.addressbar = @FALSE
   msie.statusbar = @FALSE
   msie.menubar = @FALSE
   msie.toolbar = @FALSE
   msie.visible = @TRUE
   msie.navigate(url)
   While msie.busy || msie.readystate <> 4
      TimeDelay(0.5)
   EndWhile
   Return(msie)
#EndFunction

#DefineFunction WaitForMSIE(msie)
   While msie.busy || msie.readystate <> 4
      TimeDelay(0.5)
   EndWhile
   Return
#EndFunction

url = "http://www.winbatch.com/"
msie = startMSIE(url)

AnchorCollection = msie.document.GetElementsByTagName("A")
ForEach Anchor In AnchorCollection
   If StrLower(Anchor.innerText) == "products"  ;case-insensitive check
      Anchor.style.border = ".5mm solid red"
      If AskYesNo(Anchor.href, "Click this link?")
         Anchor.click
         WaitForMSIE(msie)
         Break
      EndIf
      Anchor.style.border = ""
   EndIf
Next

Message("Debug", "All Done")
TimeDelay(3)
msie.quit

Exit

Article ID:   W17173
File Created: 2007:07:03:14:28:36
Last Updated: 2007:07:03:14:28:36