如何从壁虎的网页浏览器HTML源? innerHTML的不存在了(How to get sour

2019-10-19 02:30发布

GeckoFx V22

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

var innerHtml = element.InnerHtml;

但没有更多InnerHtml方法。 如何从壁虎的网页浏览器HTML源?

Answer 1:

投射到GeckoHtmlElement而不是GeckoElement。

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


文章来源: How to get source HTML from gecko web browser? InnerHtml does not exist any more
标签: c# gecko geckofx