homemade Posted December 9, 2009 Posted December 9, 2009 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
turbov21 Posted December 9, 2009 Posted December 9, 2009 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")
homemade Posted December 10, 2009 Author Posted December 10, 2009 No, IELoadWait doesn't seem to be doing it for me.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now