How to get source HTML from gecko web browser? InnerHtml does not exist any more

10.8k Views Asked by At

GeckoFx v22

GeckoElement element = null;
var geckoDomElement = WebBrowser1.Document.DocumentElement;
if(geckoDomElement  is GeckoElement)
  element = (GeckoElement)geckoDomElement ;

var innerHtml = element.InnerHtml;

but there is no more InnerHtml method. How to get source HTML from gecko web browser?

1

There are 1 best solutions below

0
On BEST ANSWER

Cast to GeckoHtmlElement instead of a GeckoElement.

GeckoHtmlElement element = null;
var geckoDomElement = WebBrowser1.Document.DocumentElement;
if(geckoDomElement is GeckoHtmlElement)
{
  element = (GeckoHtmlElement)geckoDomElement;    
  var innerHtml = element.InnerHtml;
}