Abfrage von Informationen auf einer Seite

  • Hallo :),
    Ich habe ein problem undzwar
    wollte ich ein tool schreiben wo man eine Ip-Adresse eintragen kann
    und dann das tool die Adresse bei zb. http://www.ip-adress.com/whois/ einträgt,
    die Informationen (nur aus dem oberren kaste) rauskopiert und Wiedergibt :)

    Hoffentlich kann mir jemand helfen

    MfG Brokolie

    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <WindowsConstants.au3>

    [/autoit][autoit][/autoit][autoit]

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("IP-CheckUp", 400, 500, 192, 124)
    $Check = GUICtrlCreateButton("Check", 32, 128, 145, 41, $BS_DEFPUSHBUTTON)
    $Close = GUICtrlCreateButton("Close", 224, 128, 145, 41, $BS_DEFPUSHBUTTON)
    $IP = GUICtrlCreateInput("Ip-Adresse", 40, 56, 329, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
    $Outout = GUICtrlCreateList("", 104, 184, 225, 214)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $Close
    Exit

    [/autoit][autoit][/autoit][autoit]

    EndSwitch
    WEnd

    [/autoit]
  • Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <WindowsConstants.au3>
    #include <IE.au3>
    #include <Array.au3>
    #include <String.au3>

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("IP-CheckUp", 400, 500, 192, 124)
    $Check = GUICtrlCreateButton("Check", 32, 128, 145, 41, $BS_DEFPUSHBUTTON)
    $Close = GUICtrlCreateButton("Close", 224, 128, 145, 41, $BS_DEFPUSHBUTTON)
    $IP = GUICtrlCreateInput("Ip-Adresse", 40, 56, 329, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
    $Outout = GUICtrlCreateList("", 104, 184, 225, 214)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    Func _CheckIP()
    $IP_Input = StringReplace(StringReplace(GUICtrlRead($IP)," ",""),".","")
    If Number($IP_Input) = 0 Then
    MsgBox("","","Ungülige IP: "&GUICtrlRead($IP))
    Else
    $oIE = _IECreate("http://www.ip-adress.com/whois/",1,0)
    _IELoadWait($oIE)
    $oForm = _IEFormGetCollection($oIE, 0)
    $oIP = _IEFormElementGetCollection($oForm,0)
    _IENavigate($oIE,"javascript:cleanup(this)",0)
    _IEFormElementSetValue($oIP,StringReplace(GUICtrlRead($IP)," ",""))
    _IEFormSubmit($oForm)

    [/autoit] [autoit][/autoit] [autoit]

    Sleep(1000)
    If StringInStr(_IEBodyReadText($oIE),"could not be resolved. Make sure that you enter an valid IP address, host or domainname.") AND Not StringInStr(_IEBodyReadText($oIE),StringReplace(GUICtrlRead($IP)," ","")&" server location:") Then
    MsgBox("","","Ungülige IP: "&GUICtrlRead($IP))
    Else
    $oText = _StringBetween(_IEBodyReadText($oIE),"whois information in process. Please wait",GUICtrlRead($IP)&" Whois Information")
    If Not @error Then
    $oText = $oText[0]
    MsgBox("","",$oText)
    Else
    MsgBox("","","Ein Fehler ist aufgetreten. Bitte erneut versuchen")
    EndIf
    EndIf
    _IEQuit($oIE)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $Close
    Exit
    Case $Check
    _CheckIP()
    EndSwitch
    WEnd

    [/autoit]

    EDIT : (1) - Bugs gefixed, IE unsichtbar gemacht ; (2) - _IEQuit() korrekt platziert.