I need to be able to parse an HTML template file (with the intention of injecting an SVG element into a html file, then converting it to pdf via wkhtmltopdf).
I know about the HTML Agility Pack, but it seems incapable of parsing local files (attempts to use file:// URIs have caused it to throw exceptions).
So, can anyone recommend a C# HTML parser for local HTML files?
HTML Agility Pack is fine for local files, check out this example from the docs.
Alternatively, load the content from the file into a string using something like File.ReadAllText then pass it into HtmlDocument.LoadHtml(string html)
.
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