I Seem to be unable to read HTML after a WPF web browser control has finished navigating to a page.
The reason I have to use a WebBrowser instead of a HttpClient, is because the required web page requires logging into first.
XAML:
<WebBrowser x:Name="wbBrowse" Source="anywebpage" LoadCompleted="wbBrowse_LoadCompleted">
</WebBrowser>
Code:
private void wbBrowse_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
{
var doc = wbBrowse.Document;
}
I've tried casting Document to HtmlDocument but it crashes. It's a '{System.__ComObject}' object which means nothing to me.
Thanks