AzKay Posted November 4, 2006 Share Posted November 4, 2006 (edited) My new project, Yes, I had an idea.Is going to be a script that will search a phonebook of the selected country, and return the information to a listview. What do I want to know? I want to know how to do this step:Source To Array. Basically. The link posted below, has the information I want to set into arrays. Or variables.( $address, $name, $number ) Or something similiar.// Removed, Too much. See the link's source.All that code is probly pissing you off. So, Heres the link, Incase you rather the link.http://www.whitepages.com.au/wp/resSearchA...p;Search=SearchWhich I would later have to adapt to other sites.http://www.thephonebook.bt.com/publisha.co...cation=somersetAnd a whole bunch of others. Wont this be fun?No, Im not asking for someone to do it for me. Im asking for pointers. Edited November 4, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted November 4, 2006 Share Posted November 4, 2006 are you using IE or are you just doing Inetget? Link to comment Share on other sites More sharing options...
AzKay Posted November 4, 2006 Author Share Posted November 4, 2006 (edited) are you using IE or are you just doing Inetget?WinHttpRequest, So yeah, Basically an INetGet. Something like $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oURL = "http://www.whitepages.com.au/wp/resSearch.do?" _ & "subscriberName=" & GUICtrlRead($Surname) _ & "&givenName=" & GUICtrlRead($Init) _ & "&state=" & $caseState _ & "&suburb=" & GUICtrlRead($PostCode) _ & "&street=" & GUICtrlRead($StreetName) _ & "&Search=Search" InputBox("", "", $oURL, "", 100, 10) $oHTTP.Open("POST", $oURL) $oHTTP.Send() $HTMLSource = $oHTTP.Responsetext $HTMLSource being the source. Ofcourse. Edited November 4, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted November 4, 2006 Author Share Posted November 4, 2006 I think ive got it. I tryed using StringRegExp(), After seeing Smoke using it, And thought it might help. So, I got the newest beta, Checked it out, and just edited the example abit and got: $nOffset = 1 $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oURL = "http://www.whitepages.com.au/wp/resSearch.do?" _ & "subscriberName=" & "antonopoulos" _ & "&givenName=" & "" _ & "&state=" & "NSW" _ & "&suburb=" & "" _ & "&street=" & "" _ & "&Search=Search" $oHTTP.Open("POST", $oURL) $oHTTP.Send() $HTMLSource = $oHTTP.Responsetext While 1 $array = StringRegExp($HTMLSource, '<li class=''entryData address''>(.*?)</li>', 1, $nOffset) If @error = 0 Then $nOffset = @extended Else ExitLoop EndIf for $i = 0 to UBound($array) - 1 msgbox(0, "RegExp Test with Option 1 - " & $i, $array[$i]) Next WEnd # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 4, 2006 Moderators Share Posted November 4, 2006 (edited) I think ive got it. I tryed using StringRegExp(), After seeing Smoke using it, And thought it might help. So, I got the newest beta, Checked it out, and just edited the example abit and got: $nOffset = 1 $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oURL = "http://www.whitepages.com.au/wp/resSearch.do?" _ & "subscriberName=" & "antonopoulos" _ & "&givenName=" & "" _ & "&state=" & "NSW" _ & "&suburb=" & "" _ & "&street=" & "" _ & "&Search=Search" $oHTTP.Open("POST", $oURL) $oHTTP.Send() $HTMLSource = $oHTTP.Responsetext While 1 $array = StringRegExp($HTMLSource, '<li class=''entryData address''>(.*?)</li>', 1, $nOffset) If @error = 0 Then $nOffset = @extended Else ExitLoop EndIf for $i = 0 to UBound($array) - 1 msgbox(0, "RegExp Test with Option 1 - " & $i, $array[$i]) Next WEndThere a _StrBetween() function I wrote in the scripts and scraps Azkay. Edited November 4, 2006 by SmOke_N 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. Link to comment Share on other sites More sharing options...
AzKay Posted November 5, 2006 Author Share Posted November 5, 2006 (edited) There a _StrBetween() function I wrote in the scripts and scraps Azkay.Yeah, Ive used that before. I guess I forgot about it. Well, Seeing as im having a bunch of problemswith this one, For some reason, half of the "name" is returning the same, etc. I think it might work better with_StrBetween. Hehe. Well, Ill do it when I wake up. Thanks.EDIT::Oh yeah, I think the reason I didnt use _StrBetween, Was because, Theres more than one occurence of the thing im searching between.So, How would I do it with _StrBetween? Store the values in Arrays? If so. That wont be much good. Im no good at arrays. Edited November 5, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 5, 2006 Moderators Share Posted November 5, 2006 Yeah, Ive used that before. I guess I forgot about it. Well, Seeing as im having a bunch of problemswith this one, For some reason, half of the "name" is returning the same, etc. I think it might work better with_StrBetween. Hehe. Well, Ill do it when I wake up. Thanks.EDIT::Oh yeah, I think the reason I didnt use _StrBetween, Was because, Theres more than one occurence of the thing im searching between.So, How would I do it with _StrBetween? Store the values in Arrays? If so. That wont be much good. Im no good at arrays.Hmm, and how do you expect to get multiple values without an array... Eval()? 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. 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