Example #1
0
        public static void Example2()
        {
            var Document = HtmlConvert.DeserializeHtml(ExampleHtml);

            Console.WriteLine(Document["html"]["head"]["meta", 0].Properties["charset"]);
            Console.WriteLine(Document["html"]["head"]["meta", 1].Properties["name"]);
            foreach (var Line in Document["html"]["body"]["table"])
            {
                Console.WriteLine(Line.Son);
            }
        }
Example #2
0
        public static void Example1()
        {
            var Document = new HDoc(DocumentOptions.BasicHTML);

            Document["html"]["body"].AddChild("div");
            Document["html"]["body"]["div"].AddChild("a", new HProp("href", "/#"));
            Document["html"]["body"]["div"].AddChild("table");
            Document["html"]["body"]["div"]["table"].AddChildren(
                new HTag("tr"),
                new HTag("tr", new HTag("td", "SomeText")));
            var Result = HtmlConvert.SerializeHtml(Document);

            Console.WriteLine(Result);
        }