Jump to content
Sign in to follow this  
homemade

Wait until webpage loads

Recommended Posts

homemade

I have a loop to attach to a webpage, do stuff, then click next.

Obviously it takes time for a page to load so I'm trying to use IELoadWait but that doesn't seem to work.

I also tried to read the statustext but that doesn't work either.

Here is a snippet of the code I have:

While $j > 0
WinActivate("Home Page - Microsoft Internet Explorer")
$hWnd = WinGetHandle("Home Page - Microsoft Internet Explorer")
$oIE = _IEAttach($hWnd, "hwnd")
Local $sStatus
While Not ($sStatus = "Done")
    $sStatus = _IEPropertyGet ( $oIE, "statustext")
    Sleep(1900)
WEnd

Share this post


Link to post
Share on other sites
turbov21

Does this work for you?

#include <IE.au3>

_IEErrorHandlerRegister()

AutoItSetOption("MustDeclareVars", 1)

Dim $urls[3]
$urls[0] = "http://google.com/"
$urls[1] = "http://yahoo.com/"
$urls[2] = "http://bing.com/"

WinActivate("Blank Page - Windows Internet Explorer")
dIM $h = WinGetHandle("[ACTIVE]")
Dim $oIE = _IEAttach($h, "hwnd")

If @error > 0 Then
    MsgBox(0, "ERROR", @error)
    Exit
EndIf

For $x = 0 to 2
    _IENavigate($oIE, $urls[$x])
    _IELoadWait($oIE)
    MsgBox(0, "", "Finished loading:" & @CRLF & $urls[$x])
Next

Sleep(250)
_IENavigate($oIE, "about:blank")

Share this post


Link to post
Share on other sites
homemade

No, IELoadWait doesn't seem to be doing it for me.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.