Jump to content

Recommended Posts

Posted (edited)

Hello,

pls can someone give some tips how to stop error.

I have an error in script what stop work.

Error code:

C:Documents and SettingsTeodesktopodno.au3 (37) : ==> The requested action with this object has failed.:
FileWrite($odno, $oLink.href & @CRLF)
FileWrite($odno, $oLink.href ^ ERROR

script part:

Func _GetFriends()
$a = $a+1
ConsoleWrite('$a = '&$a)
_IELoadWait($oIE)
FileDelete(@DesktopDir&"/test.txt")
$oLinks = _IELinkGetCollection($oIE)
$iNumLinks = @extended
ConsoleWrite('  2. Links Found: ' & $iNumLinks & @CRLF)
  For $oLink in $oLinks
   FileWrite($odno, $oLink.href & @CRLF)
   $check = _StringBetween($oLink.href, "chatWith=", "&tkn=")
   If not @error then FileWrite(@DesktopDir&'/friends.txt',$oLink.href&@CRLF)
   $check = _StringBetween($oLink.href, "st.page=","&tkn=")
   If not @error Then
    $string=_ArrayToString($check)
    If $a < 9 Then
     $result = StringLeft($string, 1)
    Else
     $result = StringLeft($string, 2)
    EndIf
    If $result > $a Then
     ConsoleWrite ('I found it: '&$result& ' link: ' & $oLink.href & @CRLF)
     _IENavigate($oIE,$oLink.href)
     _GetFriends()
    EndIf
   EndIf
  Next
EndFunc ; ==> _GetFriends

In 3 lines that have all needed variables.. i think something stop it on line 1.

I have tried to make something like

if $oLinks.href == '' then exitloop

But that code also give error on "$oLinks.href"

That work successful when $iNumLinks is about 40.. but in case of ~25 that always give error..

Thank you so much for any tips.

Edited by toader

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Posted

if $oLinks.href == '' then exitloop
is wrong because $oLinks is a collection of link objects. You need to access $oLink

Before accessing the property of an object you could test if it's an object:

If Not IsObj($oLink) Then ExitLoop ; Or whatever you want to do

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

THANK YOU SO MUCH for so fast replay !!! :oops:

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Posted (edited)

Sorry.. but that also don't help :oops::bye::doh:

$oLink is Object
$oLink is Object
$oLink is Object
C:Documents and SettingsTeodesktopodno.au3 (44) : ==> The requested action with this object has failed.:
FileWrite($odno, $oLink.href & @CRLF)
FileWrite($odno, $oLink.href ^ ERROR
->12:29:52 AutoIT3.exe ended.rc:1
>Exit code: 1   Time: 17.723

$oLink is Object ;) but with bug..

Edited by toader

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Posted

Could you please install the UDFs error handler by putting this at the top of your script (somewhere after #include <ie.au3>):

$iResult = _IEErrorHandlerRegister()
If $iResult <> 1 then MsgBox(0, "", "_IEErrorHandlerRegister: Error " & @error)

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted (edited)

Sorry for so long delay for replay.. Yes here is some error on last "for":

I found it: 16 link: http://xxx/dk?cmd=Friends&page=16
$a = 16  2. Links Found: 23
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
$oLink is Object
--> COM Error Encountered in odno.au3
----> $IEComErrorScriptline = 46
----> $IEComErrorNumberHex = 80070005
----> $IEComErrorNumber = -2147024891
----> $IEComErrorWinDescription = Access is denied.
----> $IEComErrorDescription =
----> $IEComErrorSource =
----> $IEComErrorHelpFile =
----> $IEComErrorHelpContext = 0
----> $IEComErrorLastDllError = 0
--> COM Error Encountered in odno.au3
----> $IEComErrorScriptline = 47
----> $IEComErrorNumberHex = 80070005
----> $IEComErrorNumber = -2147024891
----> $IEComErrorWinDescription = Access is denied.
----> $IEComErrorDescription =
----> $IEComErrorSource =
----> $IEComErrorHelpFile =
----> $IEComErrorHelpContext = 0
----> $IEComErrorLastDllError = 0
--> COM Error Encountered in odno.au3
----> $IEComErrorScriptline = 49
----> $IEComErrorNumberHex = 80070005
----> $IEComErrorNumber = -2147024891
----> $IEComErrorWinDescription = Access is denied.
----> $IEComErrorDescription =
----> $IEComErrorSource =
----> $IEComErrorHelpFile =
----> $IEComErrorHelpContext = 0
----> $IEComErrorLastDllError = 0
$oLink is Object

Last links of Object 21,22 and 23:

http://xxx/dk?cmd=friendMain&friendId=ovqhoidgzrljhrcod0qilrjuzcdbreyfwok
http://xxx/dk?cmd=userFriends&st.page=15&tkn=5317
http://xxx/dk?cmd=userMain

That is standard links code parsed about 147 links before this error.

Also that is last page and last 3 links...

Line 38-63 FOR

For $oLink in $oLinks
If IsObj($oLink) == 0 Then
  MsgBox(0,'','that is not obj')
Elseif IsObj($oLink) == 1 Then
  ConsoleWrite('$oLink is Object'&@CRLF)
Else
  ConsoleWrite('i don"t know'&@CRLF)
EndIf
   FileWrite($odno, $oLink.href & @CRLF) ;line 46
   $check = _StringBetween($oLink.href, "chatWith=", "&tkn=") ;line 47
   If not @error then FileWrite(@DesktopDir&'/friends.txt',$oLink.href&@CRLF) ;line 48
   $check = _StringBetween($oLink.href, "st.page=","&tkn=")
   If not @error Then
    $string=_ArrayToString($check)
    If $a < 9 Then
     $result = StringLeft($string, 1)
    Else
     $result = StringLeft($string, 2)
    EndIf
    If $result > $a Then
     ConsoleWrite ('I found it: '&$result& ' link: ' & $oLink.href & @CRLF)
     _IENavigate($oIE,$oLink.href)
     _GetFriends()
    EndIf
   EndIf
  Next

Also i have it when script is started... but that errors is from start and don't stop work of script:

1. Navigate to Login Page
--> IE.au3 V2.4-0 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch
--> IE.au3 V2.4-0 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch
--> IE.au3 V2.4-0 Warning from function _IEFormElementGetObjByName, $_IEStatus_NoMatch
--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType
2. Navigate to Main Page

All time from start this for don't make any errors... after repeating about 16 times at finish errors are shown :oops:

Edited by toader

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Posted

As I now can see some more of your code I see some "trigger" words like "login page".

What do you exactly try to do?

Do you automatically login to a web page and then grab some links?

Please elaborate bevore we can give further advice.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted
Ok, thanks..

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

  • Moderators
Posted

toader,

I have just locked the other thread in which you posted a similar script. Please do not post any more scripts which break the Forum Rules - two in a day is quite enough. :oops:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...