foray Posted April 27, 2009 Share Posted April 27, 2009 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! Link to comment Share on other sites More sharing options...
Dougiefresh Posted April 27, 2009 Share Posted April 27, 2009 Just a question: Why does it make a difference what website you're being redirected to? I'm just curious, that's all.... Link to comment Share on other sites More sharing options...
lordicast Posted April 27, 2009 Share Posted April 27, 2009 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] Link to comment Share on other sites More sharing options...
foray Posted April 27, 2009 Author Share Posted April 27, 2009 thanks for help, works fine for www.autoitscript.com but unfortanely not for my use (for example http://newsurl.de/u/hQuveeH)any ideas?! Link to comment Share on other sites More sharing options...
lordicast Posted April 27, 2009 Share Posted April 27, 2009 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] Link to comment Share on other sites More sharing options...
BrettF Posted April 28, 2009 Share Posted April 28, 2009 Try looking at HTTP.au3 and taking a look at the headers... might be something in there? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now