Thanks for the help, I got it now. Here is the full thing of code that I
used...
System.Collections.Specialized.NameValueCollection values = new System.
Collections.Specialized.NameValueCollection();
values.Add("street_number","113");
values.Add("street_name","MCINNES");
values.Add("prov","AB");
WebClient webclient = new WebClient();
webclient.Headers.Add("Content-Type","application/x-www-form-urlencoded");
byte[] responseArray = webclient.UploadValues(
"http://www.canadapost.ca/tools/pcl/bin/cp_search_response-e.asp","POST",
values);
string response = System.Text.Encoding.ASCII.GetString(responseArray );
this.message_textBox.Text=
response.Substring(response.IndexOf("AB",response.
IndexOf("PCLFormattedAddress"))+4,7);
"bruce barker" <no***********@safeco.com> wrote in message
news:ON**************@tk2msftngp13.phx.gbl...
1) use webclient class to call the website.
2) hit the page and view source to see what the input control names are
3) post the page with the values you want.
4) write code to parse the returning html for the values you want. a few
reg
expressions ought to work.
-- bruce (sqlwork.com)
"Brent" <b@b.com> wrote in message
news:eq****************@tk2msftngp13.phx.gbl... Hi,
I want to build an app (C#, windows app, or web app, shouldn't make a
difference) that submits an address to the canada post website's address
lookup and then scrape the postal code out of the resulting page. Here is
their page. http://www.canadapost.ca/tools/pcl/bin/advanced-e.asp It uses
a form post.
I would like a basic rundown of how to submit my own info into their
results page (post), and then scrape out the info I need.
Thanks,
Brent