_IEFormGetCollection & _IEFormElementGetCollection suche Hilfe!

  • Hallo!
    Ich habe eine Liste mit mehreren Web-Proxys.
    Auf jedem Web-Proxy sollte es eine Eingabezeile und ein "submit"-Button geben.

    Ich möchte nun diese Eingabezeile und den "submit"-Button finden!

    Probleme:
    Es kann sein das die Eingabezeile nicht in "form" 0 sondern in "form" 1 liegt.
    Nicht immer heisst die Eingabezeile "u".

    Der Form_Collector findet den "submit"-Button nicht.

    Ich hab mal die "schlimmen" Proxys in die List.txt getan!
    Danke!

    Form_Collector.au3:

    Spoiler anzeigen
    [autoit]

    #include <IE.au3>
    $Url = 'http://www.healthysafe.cn'
    $oIE = _IECreate ($Url, 0, 0, 1, 1)
    $oForms = _IEFormGetCollection ($oIE)
    If @error Then
    MsgBox(0, '', 'Keine Formen enthalten')
    Else
    $Index = 0
    For $oForm In $oForms
    ConsoleWrite('Form-Index: ' & $Index & ' / Name: ' & $oForm.Name & @CRLF)
    $oFormElements = _IEFormElementGetCollection($oForm)
    If IsObj($oFormElements) Then
    $IndexElement = 0
    For $oElement In $oFormElements
    ConsoleWrite('Form: ' & $Index & ' /Element: ' & $IndexElement & ' /Name: ' & $oElement.Name & @CRLF)
    $IndexElement += 1
    Next
    EndIf
    $Index += 1
    Next
    EndIf

    [/autoit]

    callHP.au3:

    Spoiler anzeigen
    [autoit]

    #include <file.au3>
    #include <array.au3>
    #include <string.au3>
    #include <IE.au3>
    ;declare
    Global $targeturl = "www.google.de"
    Global $ProxyFile = "List.txt"
    Global $ProxyCount = _FileCountLines($ProxyFile)
    Global $aLine
    ;Main
    _FileReadToArray($ProxyFile, $aLine)
    For $i = 1 To UBound($aLine) -1
    _callProxyHP($aLine[$i], $targeturl)
    Next
    For $az = 1 to $ProxyCount
    $ProxAct = FileOpen("List.txt", 1)
    $ProxyAddress = FileReadLine($ProxAct, $az)
    _callProxyHP($ProxyAddress, $targeturl)
    Next
    ;func _callProxyHP($url, $targeturl)
    func _callProxyHP($url, $targeturl)
    $IE = _IECreate($url, 0, 0, 1, 1)
    $oForm = _IEFormGetCollection ($IE,0) ; <== Nummer der "Form"
    $oName = _IEFormElementGetObjByName ($oForm, "u")
    _IEFormElementSetValue ($oName, $targeturl) ;Text eingeben
    _IEFormSubmit ($oForm)
    EndFunc

    [/autoit]

    Test.au3:

    Spoiler anzeigen
    [autoit]

    #include <IE.au3>
    $oIE = _IECreate("http://www.healthysafe.cn", 0, 0, 1, 1)
    $oInputs = _IETagNameGetCollection ($oIE, "input")
    $oForms = _IEFormGetCollection ($oIE)
    For $oInput In $oInputs
    MsgBox(0, "Fromular Input Typ", "Formular: " & $oInput.form.name & " Typ: " & $oInput.type)
    If $oInput.type = "text" Then
    $Index = 0
    For $oForm In $oForms
    $oFormElements = _IEFormElementGetCollection($oForm)
    If IsObj($oFormElements) Then
    $IndexElement = 0
    For $oElement In $oFormElements
    ConsoleWrite('Form: ' & $Index & ' /Element: ' & $IndexElement & ' /Name: ' & $oElement.Name & @CRLF)
    $IndexElement += 1
    Next
    EndIf
    Next
    EndIf
    Next

    [/autoit]


    Woher weiss ich nun also was die Eingabezeile ist bzw. wie heisst sie?