Jump to content
Sign in to follow this  
foray

Receive Url from "_INetGetSource"

Recommended Posts

foray

hey there i receive a sourcecode from a webpage with "_INetGetSource",

due to the redirect in the startingurl the ending url isn´t the starturl i throw

in "_INetGetSource". is there a way to get the ending url?!

or another HIDDEN solution?! thankssss!

Share this post


Link to post
Share on other sites
Dougiefresh

Just a question: Why does it make a difference what website you're being redirected to? I'm just curious, that's all....

Share this post


Link to post
Share on other sites
lordicast

This works...

#include <Array.au3>
#include <INet.au3>
Global $Website = InputBox('Website','Web URL to search for source for links?','www.autoitscript.com')
Main()

While 1 
    sleep(100)
WEnd


Func Main()
$iUrl = _INetGetSource($Website)
$test = StringReplace($iUrl, '"http://', '-')
Local $Num = @extended
for $i = 1 to $Num Step 1
$1st = StringInStr($iUrl,'"http://',0,$i)
$2nd = StringInStr($iUrl,'"',0,1,$1st+1)
$Last = $2nd - $1st
$Find = StringMid($iUrl,$1st+1,$last-1)
IniWrite(@ScriptDir & '\url.ini',$website, "Main-Links"&$i,$Find)
Next
$test2 = StringReplace($iUrl, '<a href="', '-')
Local $Num2 = @extended
for $x = 1 to $Num2 Step 1
$Link1 = StringInStr($iUrl,'<a href="',0,$x)
$Link2 = StringInStr($iUrl,'">',0,1,$Link1)
$LinkL = $Link2 - $Link1
$Links = StringMid($iUrl,$Link1,$LinkL+2)
IniWrite(@ScriptDir & '\url.ini',$website, "Sub-Links"&$x,$Links)
Next
$rUrl = IniReadSection(@ScriptDir & '\url.ini',$Website)
    _ArrayDisplay($rUrl)
Exit
EndFunc

[Cheeky]Comment[/Cheeky]

Share this post


Link to post
Share on other sites
lordicast

The re-direct is being done by the server not the html code or link. This website is not being hosted just re-directed to another site or mirrored.


[Cheeky]Comment[/Cheeky]

Share this post


Link to post
Share on other sites
BrettF

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  

×