OK, I have an update to make. Now it kind of works and yet it does not work. I am getting close.
I have a C# WPF application which uses a WebBrowser class. I have overwritten the LoadComplete method as well as several other methods to try to get the html content after the pages is loaded:
Code
String URL = textBox1.Text;
URL = URL.Replace(' ', '+');
webbrowser1 = new WebBrowser();
webbrowser1.LoadCompleted += new LoadCompletedEventHandler(webbrowser1_LoadCompleted);
webbrowser1.Loaded += new RoutedEventHandler(webbrowser1_Loaded);
webbrowser1.Navigated += webbrowser1_Navigated;
grd.Children.Add(webbrowser1);
int i = 0;
webbrowser1.Navigate(new Uri("https://www.google.com/#q=" + URL + ....
I have put breakpoints in these methods and I have written code to grap the Inner HTML from the HTMLDocument of the WebBrowser class and I have output the html text to different files for each method.
Then I have run the program. While the program runs, I watch the actual program to see if the document loads. The web page that is loading is the results page of a google search query.
Visually, the output is a blank, white page when eaqch method for LoadComplete, Loaded and Navagated is hit while I run through the code. It is only after the methods have been hit (some a couple of times) and the program is idle does the display show the results page.
The HTML code that is output to files does not represent the google search results page. Instead, it represents the google home page and does not have ny of the results. Any ideas? How can I programatically get the results page?