Hey Leute,
ich habe folgendes Problem: Ich will mit _FFLinksGetAll alle Links einer Seite mir anzeigen lassen. Das funktioniert auch soweit, jedoch wenn ich die einzelnen Arrays in einen String umwandeln will, wird mir nichts mehr angezeigt sozusagen.
Spoiler anzeigen
$input = InputBox ("Seite zum parsen","URLt")
_FFStart ($input,"default",2,False)
_FFWindowClose () ;wegen dem 2424 fenster da^^
$links = _FFLinksGetAll ()
_ArrayDisplay ($links) ;funktioniert wunderbar
For $i = 0 to 9
$string = _ArrayToString ($links[79][$i])
MsgBox (16,"",$string) ;gibt nichts aus
Next
Hier noch die Funktion aus der FF.au3:
Spoiler anzeigen
; #FUNCTION# ===================================================================
; Name ..........: _FFLinksGetAll
; Description ...: Returns an array with informations about all existing links.
; Beschreibung ..: Gibt ein Array mit Informationen über alle vorhandenen Links zurück.
; AutoIt Version : V3.3.0.0
; Syntax ........: _FFLinksGetAll()
; Parameter(s): .:
; Return Value ..: Success - 2 dim array with the link informations:
; | array[n][0] = href
; | array[n][1] = hash
; | array[n][2] = search
; | array[n][3] = name
; | array[n][4] = id
; | array[n][5] = text
; | array[n][6] = innerHTML
; | array[n][7] = target
; | array[n][8] = protocol
; | array[n][9] = port
; Failure - array[0][0] = 0
; @ERROR -
; Author(s) .....: Thorsten Willert
; Date ..........: Tue Sep 22 12:00:34 CEST 2009 @458 /Internet Time/
; Link ..........:
; Related .......:
; Example .......: Yes
; ==============================================================================
Func _FFLinksGetAll()
Local Const $sFuncName = "_FFLinksGetAll"
Local $aInfo, $sInfo, $aRet[1][9], $aTmp
Local $sDelimiter
Local $bTrc = $_FF_COM_TRACE
$_FF_COM_TRACE = False
If _FFGetLength() > 0 Then
$sDelimiter = "FF" & Random(1000, 9999, 1)
$sInfo = _FFCmd('FFau3.GetLinks("' & $sDelimiter & '");')
$aInfo = StringSplit($sInfo, @CRLF)
If @error Then
$_FF_COM_TRACE = $bTrc
SetError(__FFError($sFuncName, $_FF_ERROR_NoMatch))
Return $aRet[0][0] = 0
EndIf
ReDim $aRet[$aInfo[0] - 1][9]
For $i = 1 To $aInfo[0] - 1
$aTmp = StringSplit($aInfo[$i], $sDelimiter, 1)
If @error Then
SetError(__FFError($sFuncName, $_FF_ERROR_RetValue, "StringSplit: " & $aInfo[$i]))
ExitLoop
EndIf
If UBound($aTmp) <> 11 Then
$sDelimiter = "FF" & Random(1000, 9999, 1)
$sInfo = _FFCmd("FFau3.GetLinkInfo(" & $i & " ,'top','" & $sDelimiter & "')")
$aTmp = StringSplit($sInfo, $sDelimiter, 1)
EndIf
For $j = 1 To $aTmp[0] - 1
$aRet[$i - 1][$j - 1] = $aTmp[$j]
Next
Next
$_FF_COM_TRACE = $bTrc
Return $aRet
Else
SetError(__FFError($sFuncName, $_FF_ERROR_NoMatch))
$aRet[0][0] = 0
EndIf
$_FF_COM_TRACE = $bTrc
SetError(__FFError($sFuncName, $_FF_ERROR_GeneralError))
Return $aRet[0][0] = 0
EndFunc ;==>_FFLinksGetAll
Außerdem gibt mir die Konsole noch aus:
Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
$string = _ArrayToString ($links[79][$i],"")
$string = _ArrayToString (^ ERROR
Aber in der Funktion steht doch ganz klar drin, dass ein 2-dimensionales Array erstellt wird?!
Danke
Liebe Grüße