how i search a string with google from a console appliction?

  • Thread starter Thread starter Lian
  • Start date Start date
L

Lian

Hi
I am making a console application, which I need to search a string
with google . How can I do it?
Liran
 
Hi Liran,

Check this sample:
string myQuery = "SampleQuery";
// Creating new HttpWebRequest
HttpWebRequest myRequest = (HttpWebRequest)
WebRequest.Create("http://www.google.com/search?q=" + myQuery);
// Execute the request
HttpWebResponse response = (HttpWebResponse)myRequest.GetResponse();

Then just use Stream myStream = response.GetResponseStream (); and read or
parse or do whatever you like with your response :)

Regards,
Peter
(http://blog.jausovec.net)
 
Lian said:
I am making a console application, which I
need to search a string with google .
How can I do it?

"You may not send automated queries of any sort to Google's system
without express permission in advance from Google" - but you could
check out their Google API, which allows certain automated queries
and will save you having to parse HTML tags that might change in
future.

http://www.google.com/apis/

P.
 
Back
Top