How to get source HTML from gecko web browser? Inn

2019-08-08 20:48发布

问题:

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:

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;
}


标签: c# gecko geckofx