Search
 
SCRIPT & CODE EXAMPLE
 

HTML

htmlagility treeview

HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.LoadHtml(html);
TreeNode root = new TreeNode("HTML");
treeView1.Nodes.Add(root);

LoadTree(root, doc.DocumentNode);


void LoadTree(TreeNode treeNode, HtmlAgilityPack.HtmlNode rootNode)
{
    foreach (var node in rootNode.ChildNodes.Where(n=>n.Name!="#text"))
    {
        TreeNode n = new TreeNode(node.Name);
        node.Attributes.Select(a => a.Name + "=" + a.Value)
                       .ToList()
                       .ForEach(x => n.Nodes.Add(x));
        treeNode.Nodes.Add(n);

        LoadTree(n, node);
    }
}
Comment

PREVIOUS NEXT
Code Example
Html :: how to insert computer code to html 
Html :: Remover Acentos 
Html :: Elements can be nested inside <a Tag 
Html :: embed live crypto transactions map across multiple wallets and exchanges 
Html :: Open Dropdown pop up upwards forcely 
Html :: vmware workstation ubuntu 16.10 
Html :: Laravel 5: Mostrar HTML con Blade 
Html :: tab indent in html 
Html :: truffle vs brownie 
Html :: javascript looparray 
Html :: angular material tags list 
Html :: desactiver un boutton react 
Html :: metas that we use often in our html page 
Html :: control icon size html 
Html :: document.getElementById("demo").innerHTML = "Please follow Us on Twitter"; in href link 
Html :: fab model 
Html :: what is the bootstrap loader 
Html :: html anchor in samae page without url 
Html :: vuetify datatable header checkbox select all 
Html :: Div positioning HTML 
Html :: html poner en rojo 
Html :: ubuntu focal end of life 
Html :: link html code 
Html :: how to get a result in the input form 
Html :: Laravel get the data and display it in the blade html failed 
Html :: Html Count div tags any website 
Html :: mise en forme 
Html :: add link to text using span html 
Html :: how to put more than one javascript function in an html tag 
Html :: angular html interpret html 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =