I want to show the DOM as it is on the web browser with all comments and html, head, body, etc.. preserve its structure. Currently, I can only start from node html. Document.All didnt help.
The only way I can see is webBrowser1.Document.Body but I would miss the commentss, head etc.. Then if I go with Document.All then that gives me all the nodes.
I want to show the DOM as it is on the web browser with
Share
I think the only choice with the WebBrowser control to get what you want is to use
Document.All. Although this gives all elements not just top-level, each element has a.Parentelement property so you can loop through them (or use Linq) and get only the ones that have<body>or<head>as the parent element.