Right now I am using this code:
string url = "http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=hey&esrch=FT1";
string source = getPageSource(url);
string[] stringSeparators = new string[] { "<b>", "</b>" };
string[] b = source.Split(stringSeparators, StringSplitOptions.None);
bool isResultNum = false;
foreach (string s in b)
{
if (isResultNum)
{
MessageBox.Show(s.Replace(",", ""));
return;
}
if (s.Contains(" of about "))
{
isResultNum = true;
}
}
Unfortunately it is very slow, is there a better way to do it? Also is it legal to query google like this? From the answer in this question it didn't sound like it was http://stackoverflow.com/questions/903747/how-to-download-google-search-results