How to create an html document from scratch using the HtmlAgility package

I just wanted to create my own simple document using the agility package to create a new HtmlDocument containing only the basic elements of the container - i.e.

<html><head></head><body></body></html> 

How can I do this from scratch without loading the htmldocument file.

+6
source share
1 answer

Even simpler:

 var doc = new HtmlDocument(); var node = HtmlNode.CreateNode("<html><head></head><body></body></html>"); doc.DocumentNode.AppendChild(node); 
+20
source

Source: https://habr.com/ru/post/905731/


All Articles