My old WinForm application used HtmlElementCollection to process a page
HtmlDocument doc = Browser.Document;
HtmlElementCollection elems = doc.GetElementsByTagName("table");
HtmlElement a = elems[0];
int[] Hucrn = new int[] { 0, 1, 2, 3, 4, 5, 6, };
HtmlElementCollection satirlar = a.GetElementsByTagName("tr");
ı want to use webview2. But I am not getting htmlelementcollection.
Does anyone know of a way to do this?
As an alternative to using JavaScript to interact with the DOM you can install WebView2.DevTools.Dom from Nuget.org. It's free for anyone to use. Project on GitHub.
Your code would look something like:
More details and examples in the Readme. I'm working on a guide for those porting from the old
IE WebBrowser
which is at https://github.com/ChromiumDotNet/WebView2.DevTools.Dom/discussions/3