Knowing that I can’t use HTMLAgilityPack, only straight .NET, say I have a string that contains some HTML that I need to parse and edit in such ways:
- find specific controls in the hierarchy by id or by tag
- modify (and ideally create) attributes of those found elements
Are there methods available in .net to do so?
HtmlDocument
GetElementById
HtmlElement
You can create a dummy html document.
Output:
2
file:///c:
about:myUrl
Editing elements:
Output:
file:///d: