Jump to content
Sign in to follow this  
Juanola

Get Value of one result form in IE [SOLVED]

Recommended Posts

Juanola

Test It please.

It is the script

#include <IE.au3>

$o_IE = _IECreate ("http://www.selfseo.com/ip_to_country.php", 0, 1, 1, 0)
$Load1 = _IELoadWait($o_IE, 0, 10000)
If $Load1 = 0 Then
    MsgBox(0, "Error", "Cannot open " & "http://www.selfseo.com/ip_to_country.php" & ". Please make sure that you entered correct URL and check if site is online.")
    _IEQuit($o_IE)
EndIf

sleep(500)

$o_form = _IEFormGetObjByName($o_IE, "search")
$o_search = _IEFormElementGetObjByName($o_form, "ip")

_IEFormElementSetValue($o_search, "82.193.149.51")
sleep(500)
_IEFormSubmit($o_form)

$oSubmit = _IEGetObjByName($o_form, "submit")

_IEAction ($oSubmit, "focus")

ControlSend($o_IE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}")

sleep(9000)

$text = WinGetText("[CLASS:Internet Explorer_Server; INSTANCE:1]", "")
MsgBox(0, "Text read:", $text)

_IEQuit($o_IE)

How Can I read the result text: "The IP address 82.193.149.51 is assigned to Russian Federation" ???

Thank you!

Edited by Juanola

Share this post


Link to post
Share on other sites
Authenticity

#include <IE.au3>
#include <Array.au3>

Dim $aResults
$o_IE = _IECreate ("http://www.selfseo.com/ip_to_country.php")

$o_form = _IEFormGetObjByName($o_IE, "search")
$o_search = _IEFormElementGetObjByName($o_form, "ip")
$o_Input = _IEFormElementGetObjByName($o_form, "submit")

_IEFormElementSetValue($o_search, "82.193.149.51")
$o_Input.Click
_IELoadWait($o_IE)

$cTags = _IETagNameGetCollection($o_IE, "center")

For $cTag In $cTags
    $aResults = StringRegExp($cTag.outerText, "(The IP.*)", 1)
    If Not @error Then ExitLoop
Next

_ArrayDisplay($aResults)

Share this post


Link to post
Share on other sites
Juanola

Thank you very much!!

Your script is great and your solution too!!

5 stars!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.