guestscripter Posted January 25, 2014 Share Posted January 25, 2014 To save time in scripts that are heavier with IE.au3, has anybody tried to not wait for entire pages to load and instead just wait for "enough" of the page to be loaded before continueing the script? I´ve tried things like this now, to no success yet: Func _CustomIELoadWait($sStringToWaitFor = "</form") For $iCounter = 1 To 20 $html = _IEPropertyGet($g_oIE, "innerhtml") If StringInStr($html, $sStringToWaitFor) And (_IEPropertyGet($g_oIE, "readystate") = 3 Or _IEPropertyGet($g_oIE, "readystate") = 4) Then Return Sleep(100) Next EndFunc ;==>_CustomIELoadWait It actually takes longer this way than with IELoadWait. Hmm? ImageSearch15.au3 featuring _ImageSearchStartup() and _ImageSearchShutdown() Link to comment Share on other sites More sharing options...
JohnOne Posted January 25, 2014 Share Posted January 25, 2014 Did you disable the default loadwait in creation and navigation. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
guestscripter Posted January 25, 2014 Author Share Posted January 25, 2014 Did you disable the default loadwait in creation and navigation. Yes, while I was testing "alternative possibilities", I disabled those. ImageSearch15.au3 featuring _ImageSearchStartup() and _ImageSearchShutdown() Link to comment Share on other sites More sharing options...
guestscripter Posted January 25, 2014 Author Share Posted January 25, 2014 (edited) I´m thinking along the lines now of turning off the loading (not just the showing) of images (and maybe javascript) to speed up loading, and/or some kind of working function that stops loading the page when *enough* (in terms of html content I guess) of the page has been loaded. Any ideas? P.S. I imagine I can use some kind of combination of _IEAction($oIE,"stop"); which I wasn´t before, which is maybe why there was trouble with interacting with the page... and _IEPropertyGet($oIE,"outerhtml"); with perhaps IsString() and/or StringLen() and/or StringInStr() and _IEPropertyGet($oIE,"readystate"); maybe someone can give more insight into the possible return values P.P.S. I suppose it might help to look into the IE.au3 UDF IELoadWait() functions code and see how it works in the backgroudn, then try to customise it... Feel free anybody to put me on a better track :-) Edited January 25, 2014 by guestscripter ImageSearch15.au3 featuring _ImageSearchStartup() and _ImageSearchShutdown() Link to comment Share on other sites More sharing options...
Solution JohnOne Posted January 26, 2014 Solution Share Posted January 26, 2014 You cannot load a page any faster than it already does, IE is just as optimized as the rest. All you can do is loop some code waiting for your target element to be present, before acting on it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
guestscripter Posted January 26, 2014 Author Share Posted January 26, 2014 OK, well that´s a fair enough answer. Thanks. ImageSearch15.au3 featuring _ImageSearchStartup() and _ImageSearchShutdown() Link to comment Share on other sites More sharing options...
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