I think the WebBrowser management approach is probably good and independent of third-party libraries. Here is what I intend to use, and this solves the problem of waiting for the page to load:
private string ReadPage(string Link) { using (var client = new WebClient()) { this.wbrwPages.Navigate(Link); while (this.wbrwPages.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); } ReadPage = this.wbrwPages.DocumentText; } }
I will get information from HTML through some form of DOM or XPath. I am curious if others have comments about entering the "while" loop and depending on the "full" state to get me out of it. I can also set a timer there - just to be safe.
source share