Jump to content

_IELoadWait problem in IE.au3 with $o_object.document.readyState


Recommended Posts

Hello all,

i have a problem with the function _IELoadWait.

first I had the WEnd failure and fixed it with this patch:

But does not help realy. So I take a look at the function it self.

This is the function with the problem:

While Not (String($value) = "complete" Or $value = 4 Or $f_Abort)
; Trap unrecoverable COM errors
If $i_ErrorStatusCode = $_IEStatus_ComError And __IEComErrorUnrecoverable() Then
$i_ErrorStatusCode = __IEComErrorUnrecoverable()
$f_Abort = True
ElseIf (TimerDiff($IELoadWaitTimer) > $i_timeout) Then
$i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout
$f_Abort = True
EndIf
Sleep(100)
$value = $o_object.document.readyState
$i_ErrorStatusCode = @error
WEnd

After my search it looks like that the object $o_object.top.document.readyState disapear.

It runs normally through the while if the status is complete or loading. But the I get this error:

$value = $o_object.top.document.readyState^ ERROR

I tried to catch it but it does not work. I don't know why. I wrote quick and dirty some functions in there to find the content of the object or if the object are there. But get no correct result.

While (String($value) = "loading")
If $i_ErrorStatusCode = $_IEStatus_ComError And __IEComErrorUnrecoverable() Then
$i_ErrorStatusCode = __IEComErrorUnrecoverable()
$f_Abort = True
ElseIf (TimerDiff($IELoadWaitTimer) > $i_timeout) Then
$i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout
$f_Abort = True
EndIf
Sleep(100)
If Not IsDeclared( "o_object" ) Then ConsoleWrite("objektnichtdeklariert ")
If Not IsDeclared( "o_object.document" ) Then ConsoleWrite("documentnichtdeklariert ")
If Not IsDeclared( "o_object.document.readyState" ) Then ConsoleWrite("statenichtdeklariert ")
ConsoleWrite("eval "& String(Eval("o_object.document.readyState")))
if IsString($o_object.document.readyState) then
ConsoleWrite("True")
ConsoleWrite($o_object.document.readyState)
Else
ConsoleWrite("False")
ConsoleWrite($o_object.document.readyState)
EndIf
$value = $o_object.document.readyState
$i_ErrorStatusCode = @error
WEnd

isDeclared are not working, I get everytime the message that the object is not there also when its working fine through the while.

eval dont return any content.

I don't know the reason when the object are destroyed but until then the while is working.

Anybody an idea how I can change the while that it runs through also when the object is destroyed or not able to get the content of it?

Edited by nauen
Link to comment
Share on other sites

The document object is routinely destroyed and recreated during a navigation.

Try using _IEErrorHandlerRegister() so that COM errors are not fatal to your script.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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...