I obtain a webpage's html code (as a string) using a WebClient.
However I want to turn it into an HtmlDocument object so I can use the DOM features this class offers. Currently the only way I know how to do it - is using a Browser control as follows:
string pageHtml = client.DownloadString(url);
browser.ScriptErrorsSuppressed = true;
browser.DocumentText = pageHtml;
do
{
Application.DoEvents();
} while (browser.ReadyState != WebBrowserReadyState.Complete);
return browser.Document;
Is there another way of doing it? I know there are other browser controls avaliable, but is there a simpler way?