Hi,
Here is some sample code:
Code: C#
//EvalScript returns a JavaScript array
object obj = webView.EvalScript("document.getElementsByTagName('a');");
//Cast to strong typed Collection<Element>
var col = JSObject.CastTo<EO.WebBrowser.DOM.Collection<EO.WebBrowser.DOM.Element>>(obj);
//Look through all Element
int n = col.length;
for (int i = 0; i < n; i++)
{
var item = col[i];
System.Diagnostics.Debug.WriteLine(item.innerHTML);
}
Please keep in mind that such code are strongly discouraged for performance reason. See here for more details:
https://www.essentialobjects.com/doc/webbrowser/advanced/jsdom.aspxThe class exists as a fast convenience way because its nor ".NET like" and might be easier to use with certain .NET features (for example, WPF data binding) but it is very inefficient. So you should not use such code in production.
Thanks!