Reputation: 49
Without the user seeing the browser window? I want the program to search for something secretly on the internet and copy the text of the first website as the search result.
Upvotes: 1
Views: 796
Reputation: 38077
You can use the I'm Feeling Lucky URL and an HttpWebRequest
:
public Uri GetFirstResult(string term)
{
// Use the I'm Feeling Lucky URL
var url = string.Format("https://www.google.com/search?num=100&site=&source=hp&q={0}&btnI=1", term);
HttpWebRequest req = HttpWebRequest.CreateHttp(url);
return req.GetResponse().ResponseUri;
}
Upvotes: 3
Reputation: 13579
You need to use Goodle API for that.
https://code.google.com/p/google-api-for-dotnet/
Upvotes: 1