Jump to content

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

Link to comment
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.

Link to comment
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

Link to comment
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... :whistle:

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

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

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

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