HttpWebRequest req;
HttpWebResponse resp;
Stream st;
StreamReader sr;
string empid;
// TextBox2.Text = buffer;
int index = 0, rindex, tindex, groupIndex;
bool found = false;
req = (HttpWebRequest)WebRequest.Create("http://www.yell.com/ucs/UcsSearchAction.do?keywords=local+government&companyName=&location=surrey&scrambleSeed=64445904&searchType=advance&M=&bandedclarifyResults=&ssm=1&autocomplete=kwlo");
resp = (HttpWebResponse)req.GetResponse();
st = resp.GetResponseStream();
sr = new StreamReader(st);
string buffer = sr.ReadToEnd();
the buffer contains the response on the page as html
you have to parse the HTML using regular expression for the required result.
|