Sign in to follow this  
Followers 0
Edgar0024

retrieve website source code with ip address number

3 posts in this topic

I use InetGet ( "URL" [,"filename" [, reload [, background]]] ) for download source code index page site.

I want know if exist function for get webpage using IP address instead that URL name ( www.xyz.com )

If i write IP ADDRESS in function InetGet same xxx.xx.xxx.xxx dont work.

Many thanks

Edgar from Bangkok :whistle:

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$sInfo = _StringIPPTR('64.111.104.70')
MsgBox(64, @error, $sInfo)
Func _StringIPPTR($sIP, $nTypeOnly = 0)
    If Not StringRegExp($sIP, "(?:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.)){3}(?:(25[0-5]$|2[0-4]\d$|1\d{2}$|[1-9]\d$|\d$))") Then _
        Return SetError(1, 0, 0);Not a valid ip string
    If $nTypeOnly Then Return 1
    Local $sStringIP = _INetGetSource("http://www.dnsstuff.com/tools/ptr.ch?ip=" & $sIP)
    If @error Or StringInStr($sStringIP, 'Unknown Page, sorry') Then Return SetError(2, 0, 0);Either _InetGetSource failed or the link did
    If StringInStr($sStringIP, "No PTR records exist for " & $sIP) Then Return SetError(3, 0, 0);No PTR records found (Probably not a valid ip)
    Local $aSREIP = StringRegExp($sStringIP, "(?s)(?i)PTR\srecord:\s+Reports\s(.*?).\s\[", 1);
    If IsArray($aSREIP) Then Return $aSREIP[0];Returns the PTR Record
    ;Error 4 is just precautionary, if StringRegExp() fails, it's probably do to dnsstuff changing their output format
    Return SetError(4, 0, 0)
EndFunc
http://www.autoitscript.com/forum/index.ph...c=39932&hl=

Edit:

change the sad.gif to colon parenthisis

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Smoke, just disable the smilies in the post options. Under the post box. And above the post icon.


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

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  
Followers 0