Jump to content

faster "_IELoadWait" possible?


Go to solution Solved by JohnOne,

Recommended Posts

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?

Link to comment
Share on other sites

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 by guestscripter
Link to comment
Share on other sites

  • Solution

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...