fielmann Posted March 6, 2008 Share Posted March 6, 2008 Hello autoit-friends ;~~~~~~~~~~~~~~ snip ~~~~~~~~~~~~~~#include <IE.au3>while 1=1 $oIE = _IECreate ("http://www.myhomepage.com/")$sText = _IEBodyReadText ($oIE)$result = StringInStr($sText, "welcome")if $result =0 then msgbox(0,"error", "problem",10)_IEQuit ($oIE)wend;~~~~~~~~~~~~~~ snap ~~~~~~~~~~~~~~The script works, but when I cut my internet connection the script stops with the message:Title: AutoIt ErrorLine 2774 (File "C:\Programme\AutoIt3\Include\IE.au3"):$o_object.GoBack ()$o_object.GoBack ()^ ERRORError: The requested action with this object has failed. What can I do that the script is continuing?How to handle the error?Any idea is welcome!Carsten Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 6, 2008 Share Posted March 6, 2008 Hello autoit-friends ;~~~~~~~~~~~~~~ snip ~~~~~~~~~~~~~~#include <IE.au3>while 1=1 $oIE = _IECreate ("http://www.myhomepage.com/")$sText = _IEBodyReadText ($oIE)$result = StringInStr($sText, "welcome")if $result =0 then msgbox(0,"error", "problem",10)_IEQuit ($oIE)wend;~~~~~~~~~~~~~~ snap ~~~~~~~~~~~~~~The script works, but when I cut my internet connection the script stops with the message:Title: AutoIt ErrorLine 2774 (File "C:\Programme\AutoIt3\Include\IE.au3"):$o_object.GoBack ()$o_object.GoBack ()^ ERRORError: The requested action with this object has failed. What can I do that the script is continuing?How to handle the error?Any idea is welcome!CarstenWhat version of AutoIt are you running? And what version of the IE.au3 UDF? That code does not line up with the given line number in either IE.au3 version 2.3-1 (comes with AutoIt 3.2.10.0), or 2.4-0 (ships with 3.2.11.1-Beta). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Uriziel01 Posted March 6, 2008 Share Posted March 6, 2008 (edited) Meaby make it like this?? #include <IE.au3> while 1 if ping("http://www.myhomepage.com/",1000)=0 then msgbox(0,"error", "internet connection lost or serwer is down !",5) ContinueLoop else $oIE = _IECreate ("http://www.myhomepage.com/") $sText = _IEBodyReadText ($oIE) if StringInStr($sText, "welcome") = 0 then msgbox(0,"error", "problem",10) _IEQuit ($oIE) endif wend Edited March 6, 2008 by Uriziel01 Link to comment Share on other sites More sharing options...
fielmann Posted March 7, 2008 Author Share Posted March 7, 2008 What version of AutoIt are you running? And what version of the IE.au3 UDF? That code does not line up with the given line number in either IE.au3 version 2.3-1 (comes with AutoIt 3.2.10.0), or 2.4-0 (ships with 3.2.11.1-Beta). I'm using Version 3.2.4.9 from (May 25th 2007) Link to comment Share on other sites More sharing options...
fielmann Posted March 7, 2008 Author Share Posted March 7, 2008 I'm using Version 3.2.4.9 from (May 25th 2007) I've just updatet my AutoIt to Version 3.2.10.0 The problem appears also in the new version I get back the folowing error-message:>>>> Window <<<<Title: AutoIt ErrorClass: #32770Position: 448, 155Size: 351, 165Style: 0x94C80347ExStyle: 0x00010108Handle: 0x000503A8>>>> Visible Text <<<<OKLine 2780 (File "C:\Programme\AutoIt3\Include\IE.au3"):$o_object.GoBack ()$o_object.GoBack ()^ ERRORError: The requested action with this object has failed. Any idea how to fix it? Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 7, 2008 Share Posted March 7, 2008 (edited) I've just updatet my AutoIt to Version 3.2.10.0 The problem appears also in the new version I get back the folowing error-message: >>>> Window <<<< Title: AutoIt Error Class: #32770 Position: 448, 155 Size: 351, 165 Style: 0x94C80347 ExStyle: 0x00010108 Handle: 0x000503A8 >>>> Visible Text <<<< OK Line 2780 (File "C:\Programme\AutoIt3\Include\IE.au3"): $o_object.GoBack () $o_object.GoBack ()^ ERROR Error: The requested action with this object has failed. Any idea how to fix it? OK, getting to that line requires a call to _IEAction($oIE, "back"), which I don't see in the code you posted. Find out where you are doing this and check the validity of $oIE (or whatever you named the IE object) at that point in your script. P.S. There is a normal error that occurs if you try to "back" from the first page in the browser. Run this to see it: #include <IE.au3> _IEErrorHandlerRegister() $oIE = _IECreate("http://www.google.com") Sleep(1000) ; _IENavigate($oIE, "http://www.openoffice.org") Sleep(1000) _IEAction($oIE, "back") If you uncomment the _IENavigate(), then the error goes away, because there is now a page to go "back" to. But this still appears to have nothing to do with the code you cited in the OP. Edited March 7, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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