在 C# viaGeckoFx中,我沒有找到一個方法來查找元素的所有屬性。
下面是我的代碼GeckoWebBrowser GeckoBrowser =.. ..;
GeckoNode NodeElement =.. ..;//HTML element where to find all HTML attributes
string JSresult ="";
string JStext = @"
function getElementAttributes(element)
{
var AttributesAssocArray = {};
for (var index = 0; index
return JSON.stringify(AttributesAssocArray);
}
getElementAttributes(this);
";
using (AutoJSContext JScontext = new AutoJSContext(GeckoBrowser.Window.JSContext)) { JScontext.EvaluateScript(JStext, (nsISupports)NodeElement.DomObject, out JSresult); }
你是否有其他建議在 C# ( 沒有 Javascript ) 中實現這個?