# Certain sites cause error in IE.au3

## Recommended Posts

Hi,

Occassionally when working with a site via IE.au3, the following error occurs:

C:\Program Files\AutoIt3\beta\Include\IE.au3 (2162) : ==> Variable must be of type "Object".:
Return $o_object.document.body.innerHTML Return$o_object.document.body^ ERROR

The issue is with the site rather than the UDF, but is there a way that I can trap this error so that my script continues rather than bombing out?

thanks

VW

##### Share on other sites

Just a guess, but would this work?

If IsObj($o_object.document.body.innerHTML) then Return$o_object.document.body.innerHTML
Else
SetError(1)
Return 0
EndIf

Let me know if this helps.

##### Share on other sites

Hi,

I'm not sure how I use your code, as that error message is being returned by the IE udf.

I think the answer is to use _IEErrorHandlerRegister, so that the udf returns to a function that I can configure, but I need to experiment with this to see if I am on the right track or not.

Thanks

VW

##### Share on other sites

I think the answer is to use _IEErrorHandlerRegister, so that the udf returns to a function that I can configure.

##### Share on other sites

I will second that! There is no telling how many hours Dale has spent on it.

##### Share on other sites

I will second that! There is no telling how many hours Dale has spent on it.

Yeah, and I don't think I want to know that answer to that question, even if I could figure it out...

I would like to know about the characteristic of a site where you can get this error (it is in _IEBodyReadHTML). I double-checked the code and I'm having a hard time figuring out when you could get that error... unless you are passing in another type of object altogether like a Word object, or perhaps the url is ftp: type or something?

I'd like to trap for this, so if you can provide more detail I would appreciate it.

Dale

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

Automate input type=file (Related)

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

##### Share on other sites

I would like to know about the characteristic of a site where you can get this error (it is in _IEBodyReadHTML). I double-checked the code and I'm having a hard time figuring out when you could get that error... unless you are passing in another type of object altogether like a Word object, or perhaps the url is ftp: type or something?

I'd like to trap for this, so if you can provide more detail I would appreciate it.

Dale

OK, I will add some logging and I'll get back to you in the next day or so with a couple of sites and which function I am using when the error occurs.

VW

##### Share on other sites

Dale,

Where could I find a full list of the variables that I could log via the ErrorHandler?

I would like to log the URL and if possible the function I was calling.

Thanks

VW

## Create an account

Register a new account

×

• Wiki

• Back

• Git