ich probier es noch einmal in anderer Form euch zu fragen, nachdem ich nach fast 2 wochen keine antwort auf meinen Thread bekomme...
ich würde gerne wissen wie es im detail funktioniert das man einen Link klickt ohne ihn visuell über MouseClick anzuklicken, also sprich wie die Funktion _IELinkClickByText()
Grund: ich versuche mir für den Opera angepasste Browserfunktionen zu schreiben, da mir die Opera library nicht die gewünschten Funktionen bietet die ich haben möchte, aber dazu brauch ich einen kleinen start nach welchem schema das ganze abläuft.
[autoit]
;===============================================================================
;
; Function Name: _IELinkClickByText()
; Description: Simulate a mouse click on a link with text sub-string matching the string provided
; Parameter(s): $o_object - Object variable of an InternetExplorer.Application, Window or Frame object
; $s_linkText - Text displayed on the web page for the desired link to click
; $i_index - Optional: If the link text occurs more than once, specify which instance
; you want to click by 0-based index
; $f_wait - Optional: specifies whether to wait for page to load before returning
; 0 = Return immediately, not waiting for page to load
; 1 = (Default) Wait for page load to complete before returning
; Requirement(s): AutoIt3 V3.2 or higher
; Return Value(s): On Success - Returns -1
; On Failure - Returns 0 and sets @ERROR
; @ERROR - 0 ($_IEStatus_Success) = No Error
; - 1 ($_IEStatus_GeneralError) = General Error
; - 3 ($_IEStatus_InvalidDataType) = Invalid Data Type
; - 4 ($_IEStatus_InvalidObjectType) = Invalid Object Type
; - 6 ($_IEStatus_LoadWaitTimeout) = Load Wait Timeout
; - 7 ($_IEStatus_NoMatch) = No Match
; - 8 ($_IEStatus_AccessIsDenied) = Access Is Denied
; - 9 ($_IEStatus_ClientDisconnected) = Client Disconnected
; @Extended - Contains invalid parameter number
; Author(s): Dale Hohm
;
;===============================================================================
;
Func _IELinkClickByText(ByRef $o_object, $s_linkText, $i_index = 0, $f_wait = 1)
If Not IsObj($o_object) Then
__IEErrorNotify("Error", "_IELinkClickByText", "$_IEStatus_InvalidDataType")
SetError($_IEStatus_InvalidDataType, 1)
Return 0
EndIf
;
Local $found = 0, $link, $linktext, $links = $o_object.document.links
$i_index = Number($i_index)
For $link In $links
$linktext = $link.outerText & "" ; Append empty string to prevent problem with no outerText (image) links
If $linktext = $s_linkText Then
If ($found = $i_index) Then
$link.click
If $f_wait Then
_IELoadWait($o_object)
SetError(@error)
Return -1
EndIf
SetError($_IEStatus_Success)
Return -1
EndIf
$found = $found + 1
EndIf
Next
__IEErrorNotify("Warning", "_IELinkClickByText", "$_IEStatus_NoMatch")
SetError($_IEStatus_NoMatch) ; Could be caused by parameter 2, 3 or both
Return 0
EndFunc ;==>_IELinkClickByText
mir sind viele Sachen nicht ganz klar dabei.
der 1. If Block ist schon klar, worfür der ist
nur bei der Lokalen Variablendeklaration wird es schon bei mir etwas kritisch...
[autoit]
$links = $o_object.document.links
wie ist das document links zu verstehen? es scheint fast so als wäre es JavaScript Oo
also sprich:
=> $o_object ist die Url
=> .document der Quellcode der von $o_object im Focus steht
=> .links die ansammlung aller links im Quellcode!?
oder als nächstes
[autoit]
$linktext = $link.outerText & ""
das JavaScript ähnliche Attribut,... was sagt des aus?
Was mich dabei auch noch interessieren würde, sind diese JavaScript ähnlichen Befehle irgendwo in der Autoit Hilfe zu finden oder irgendwo anders und wie sie im allgemeinen anzuwenden sind?
und worauf weiter bezüglich des Quelltextes muss ich im speziellen achten wenn ich solch eine Funktion schreibe?
ich hoffe diesmal mehr erfolg zu haben bei meiner anfrage
ty