Kogmedia Posted May 26, 2007 Share Posted May 26, 2007 Keep getting this error any ideas? Return $o_object.document.body.innerText Return $o_object.document.body^ ERROR Error: Variable must be of type "Object". How can I stop the script from crashing if i get an _IE error? [font="Verdana"]Keith (Kogmedia)[/font]My ScriptQuick Search - Internet / Hard Drive Search Link to comment Share on other sites More sharing options...
DaleHohm Posted May 26, 2007 Share Posted May 26, 2007 Without sample code I cannot tell you why you get the error. To prevent script abort, use _IEErrorHandlerRegister() 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 More sharing options...
Kogmedia Posted May 26, 2007 Author Share Posted May 26, 2007 (edited) Here is the loop it breaking on Case $dif >= 10000 _IEErrorHandlerRegister () $begin = TimerInit() $HTML = _IEBodyReadText($oIE) ConsoleWriteError(@error) If @error = 3 Then;($_IEStatus_InvalidDataType) = Invalid Data Type MsgBox(0,"Error","No HTML") $HTML='' Sleep(1000) EndIf $SOURCE = _IEBodyReadHTML($oIE) ConsoleWriteError(@error) If @error = 3 Then;($_IEStatus_InvalidDataType) = Invalid Data Type MsgBox(0,"No SOURCE","") $SOURCE ='' Sleep(1000) EndIf _IEErrorHandlerDeRegister() Edited May 26, 2007 by Kogmedia [font="Verdana"]Keith (Kogmedia)[/font]My ScriptQuick Search - Internet / Hard Drive Search Link to comment Share on other sites More sharing options...
Kogmedia Posted May 26, 2007 Author Share Posted May 26, 2007 Here is my console output $oIE : 0--> COM Error Encountered in GixenPro.au3 ----> $IEComErrorScriptline = 2095 ----> $IEComErrorNumberHex = 000000A9 ----> $IEComErrorNumber = 169 ----> $IEComErrorWinDescription = Variable must be of type 'Object'. ----> $IEComErrorDescription = ----> $IEComErrorSource = ----> $IEComErrorHelpFile = ----> $IEComErrorHelpContext = ----> $IEComErrorLastDllError = 0 --> COM Error Encountered in GixenPro.au3 ----> $IEComErrorScriptline = 2064 ----> $IEComErrorNumberHex = 000000A9 ----> $IEComErrorNumber = 169 ----> $IEComErrorWinDescription = Variable must be of type 'Object'. ----> $IEComErrorDescription = ----> $IEComErrorSource = ----> $IEComErrorHelpFile = ----> $IEComErrorHelpContext = ----> $IEComErrorLastDllError = 0 [font="Verdana"]Keith (Kogmedia)[/font]My ScriptQuick Search - Internet / Hard Drive Search Link to comment Share on other sites More sharing options...
Valuater Posted May 26, 2007 Share Posted May 26, 2007 No problem here... Working Script #include<IE.au3> $oIE = _IECreate("www.autoit3.com") ;Case $dif >= 10000 _IEErrorHandlerRegister () $begin = TimerInit() $HTML = _IEBodyReadText($oIE) ConsoleWriteError("TEST ********" & @CRLF & @error) If @error = 3 Then;($_IEStatus_InvalidDataType) = Invalid Data Type MsgBox(0,"Error","No HTML") $HTML='' Sleep(1000) EndIf $SOURCE = _IEBodyReadHTML($oIE) ConsoleWriteError("TEST ********" & @CRLF & @error) If @error = 3 Then;($_IEStatus_InvalidDataType) = Invalid Data Type MsgBox(0,"No SOURCE","") $SOURCE ='' Sleep(1000) EndIf _IEErrorHandlerDeRegister() >Running:(3.2.3.10):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Program Files\AutoIt3\SciTe\Temp\2007.05.15_ixp.au3" TEST ******** 0TEST ******** 0+>08:42:02 AutoIT3.exe ended.rc:0 +>08:42:03 AutoIt3Wrapper Finished >Exit code: 0 Time: 3.161 8) Link to comment Share on other sites More sharing options...
DaleHohm Posted May 26, 2007 Share Posted May 26, 2007 Val is right. It will depend on what $oIE is pointing to and the document that it contains. For example, a PDF document will cause errors with this call because it exposes completely different objects, properties and methods to InternetExplorer. Please try to create a reproducer. 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now