I'm wondering if it possible to open a HTML Document to edit elements and attributes without the use of the WebBrowser class; I know how to use functions in HTML to do this, but unfortunately, I need the editing to occur as part of an add-in for another program (solidworks Enterprise PDM) which only allows the use of C# with NET 3.5.
I was thinking of using something like:
FileStream UpdateHTML = new FileStream(filepath, FileMode.Open, FileAccess.Write);
to give write access to html document, but I'm not sure if this is the correct path to be taking.
You may take a look at Html Agility Pack which allows you to parse and manipulate HTML:
This is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...). It is a .NET code library that allows you to parse "out of the web" HTML files. The parser is very tolerant with "real world" malformed HTML. The object model is very similar to what proposes System.Xml, but for HTML documents (or streams).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With