AzKay Posted September 15, 2006 Share Posted September 15, 2006 (edited) Well, Yes, Im trying this. Im wanting to get the 32digit number from the source text of a site.I know about the string commands. But, I need some better examples than the help file.EDIT::Hmm, Sorry, not number. Thought it was just numbers, hehe.New Question:Post #9 Edited September 15, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Don N Posted September 15, 2006 Share Posted September 15, 2006 Can you provide an example of the string you are trying to extract the number from. It will be much easier to help if we dont have to read your mind for the string _____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper Link to comment Share on other sites More sharing options...
Valuater Posted September 15, 2006 Share Posted September 15, 2006 first inetgetsource() second fileread() third use the string commands you said you understand 8) Link to comment Share on other sites More sharing options...
AzKay Posted September 15, 2006 Author Share Posted September 15, 2006 I know how to get the source and stuff already, Just dont know how im going to get the number. @Val || I meant, I dont understand them =P. Ive looked at them though. Thats why I said I would need a better example than the helpfile Heres an example source snippet, Well, What im wanting to get. <input type="hidden" name="sid" value="5f0c9e7b7bb128548f706de698f581c1" /> Im wanting to get the "value". # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Valuater Posted September 15, 2006 Share Posted September 15, 2006 there are a couple of approaches, i use stringbetween... see this posthttp://www.autoitscript.com/forum/index.ph...st&p=2288188) Link to comment Share on other sites More sharing options...
AzKay Posted September 15, 2006 Author Share Posted September 15, 2006 (edited) there are a couple of approaches, i use stringbetween... see this post http://www.autoitscript.com/forum/index.ph...st&p=228818 8)Hmm, I like it except, Would you be able to change it for me, so it searchs in the text you tell it to? for example, instead of taking it from the webpage, take it from the body of text. For example, im not using _IE functions, So, How would I work this? Im using. $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET","http://www.AutoItScript.com") $oHTTP.Send() $HTMLSource = $oHTTP.Responsetext So, I would need it to search the $HTMLSource. If im not making sense. And just confusing myself. Correct me? xD, I think I was confusing myself. I tryed to edit it just before, But I couldnt figure it out. EDIT:: I knew something was up. I didnt read it right. I dont know why I didnt see it before. Hehe, Just had to replace the $body, to the $HTMLSource. Edited September 15, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted September 15, 2006 Author Share Posted September 15, 2006 Very good, Got it working nicely ^^ # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Valuater Posted September 15, 2006 Share Posted September 15, 2006 Great! 8) Link to comment Share on other sites More sharing options...
AzKay Posted September 15, 2006 Author Share Posted September 15, 2006 New problem ;#include <String.au3> $Login = "http://www.gaiaonline.com/gaia/login.php?" $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET", $Login) $oHTTP.Send() $HTMLSource = $oHTTP.Responsetext $Sid = _StringBetween($HTMLSource, "<input type=""hidden"" name=""sid"" value=", " />") $oHTTP.Open("POST", $Login & "username=au3.Test&password=autoit&autologin=on&x=44&y=13&submit=Login&sid=" & $Sid & "&redirect=http%3A%2F%2Fwww.gaiaonline.com%2F%3F") $oHTTP.Send() $HTMLSource = $oHTTP.Responsetext ConsoleWrite($HTMLSource) ;ConsoleWrite(@CR & @CR & @CR & @CR & @CR & $Sid) Func _StringBetween($str, $start, $end) $pos = StringInStr($str, $start) If Not @error Then $str = StringTrimLeft($str, $pos + StringLen($start) - 1) $pos = StringInStr($str, $end) If Not @error Then $str = StringTrimRight($str, StringLen($str) - $pos + 1) Return $str EndIf EndIf EndFunc It doesnt seem to want to login, it just redirects to the: "POST", But, isnt that supposed to log it in? NOTE:: I dont care if you steal that user and pass. Its my autoit example mule ^^ # MY LOVE FOR YOU... IS LIKE A TRUCK- # 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