HttpwebRequest Simulate Click

Posted by Afnan on Stack Overflow See other posts from Stack Overflow or by Afnan
Published on 2011-01-08T23:31:06Z Indexed on 2011/01/09 15:53 UTC
Read the original article Hit count: 259

Filed under:
|

I was working on httpwebrequest and was trying to search google get result and simulate click to desired link. Is that possible?

 string raw ="http://www.google.com/search?hl=en&q={0}&aq=f&oq=&aqi=n1g10";
string search = string.Format(raw, HttpUtility.UrlEncode(searchTerm));
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(search);
request.Proxy = prox;
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
using (StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.ASCII))
{
HtmlElementCollection html = reader.ReadToEnd();
browserA=reader.ReadToEnd();
this.Invoke(new EventHandler(IE1));
}
}

© Stack Overflow or respective owner

Related posts about c#

Related posts about httpwebrequest