Jump to content

Recommended Posts

  • 2 months later...
Posted

"c:\Program Files (x86)\AutoIt3\Include\IE.au3" 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 1 month later...
Posted (edited)

Second interesting example, showing how to wait for full page load (with all frames):

#include <ie.au3>
#include <Timers.au3>

_IEErrorHandlerRegister(_User_ErrFunc)

_Example()

Func _Example()
;~  http://www.aaronpeters.nl/blog/iframe-loading-techniques-performance?%3E

;~  Local $oIE = _IECreate('http://www.aaronpeters.nl/blog/testpages/iframe-dynamic-after-onload.htm', 0, 1, 0)
;~  Local $oIE = _IECreate('http://www.aaronpeters.nl/blog/testpages/iframe-dynamic-asynch.htm', 0, 1, 0)
    Local $oIE = _IECreate('http://stevesouders.com/efws/iframe-onload-nonblocking.php?t=1453416601', 0, 1, 0)
    Local $hStarttime = _Timer_Init()
    _IELoadWait($oIE)
    ConsoleWrite('> 1 = ' & _Timer_Diff($hStarttime) & @CRLF)
    _IELoadWait_ForAllFrames($oIE)
    ConsoleWrite('> 2 = ' & _Timer_Diff($hStarttime) & @CRLF)
    _IEQuit($oIE)
EndFunc   ;==>_Example


Func _IELoadWait_ForAllFrames(ByRef $oObject, $iDelay = 0, $iTimeout = Default)
    _IELoadWait($oObject, $iDelay, $iTimeout)
    If @error Then Return SetError(@error, @extended, -1)

    Local $oFrames_coll = _IEFrameGetCollection($oObject)
    #forceref $oFrames_coll
    Local $iNumFrames = @extended
    Local $oFrame = Null
    For $iFrame_idx = 0 To ($iNumFrames - 1)
        $oFrame = _IEFrameGetCollection($oObject, $iFrame_idx)
        _IEDocGetObj($oFrame)
        If Not @error Then
            _IELoadWait($oFrame, $iDelay, $iTimeout)
            If @error Then Return SetError(@error, @extended, -1)
        EndIf
    Next

    Return SetError($_IESTATUS_Success, 0, 1)

EndFunc   ;==>_IELoadWait_ForAllFrames


; User's COM error function.
Func _User_ErrFunc($oError)
    ; Do anything here.
    ConsoleWrite(@ScriptFullPath & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _
            @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _
            @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _
            @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _
            @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _
            @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _
            @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _
            @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _
            @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
            @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF)
EndFunc   ;==>_User_ErrFunc

 

It was earlier published here:

 

Edited by mLipok
added COM Error Handler

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Good point. Fixed.
Thanks @JohnOne

mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 2 weeks later...
Posted

For example:

_IETagNameGetCollection(....)

 

Return Value

Success: an object variable containing the specified Tag collection, @extended = specified Tag count.
Failure: sets the @error flag to non-zero.
@error: 3 ($_IEStatus_InvalidDataType) - Invalid Data Type
4 ($_IEStatus_InvalidObjectType) - Invalid Object Type
5 ($_IEStatus_InvalidValue) - Invalid Value
7 ($_IEStatus_NoMatch) - No Match
@extended: Contains invalid parameter number

 

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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
×
×
  • Create New...