Donate

GeckoFX DocumentText Similar To Webbrowser Control (C#)

In a traditional webbrowser control, you can get the page source like this:
string pageSource = webbrowser1.DocumentText;
However, in GeckoFX webbrowser, there's no DocumentText property. A workaround is to get the InnerHtml property of html tag using the code below:
string pageSource = string.empty;   
 if (!string.IsNullOrEmpty(this.Document.GetElementsByTagName("html")[0].InnerHtml))  
     pageSource = this.Document.GetElementsByTagName("html")[0].InnerHtml;
Cheers!

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.