Exemplo n.º 1
0
        static void Main(string[] args)
        {
            SusiParser parser = new SusiParser();
            parser.Login("nikola1", File.ReadAllText(passwordFile).Trim());
            string examPage = parser.GetExamPage();

            HtmlDocument document = new HtmlDocument();
            document.LoadHtml(examPage);

            string xpath = @"//table";////table";//[width=""100%""]";//tr[@class!=""greyType2""]";

            HtmlNodeCollection nodes = document.DocumentNode.SelectNodes(xpath);

            foreach (var node in nodes)
            {
                var children = node.SelectNodes(xpath);
                foreach (var child in children)
                {

                    Console.WriteLine(child.OuterHtml);
                }
            }

            //HtmlNode current = document.DocumentNode;
            //List<HtmlNode> tables = new List<HtmlNode>();
            //foreach (var node in current.ChildNodes)
            //{
            //	if (node.NodeType == HtmlNodeType.Element && node.
            //}
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            SusiParser parser = new SusiParser();

            parser.Login("nikola1", File.ReadAllText(passwordFile).Trim());
            string examPage = parser.GetExamPage();

            HtmlDocument document = new HtmlDocument();

            document.LoadHtml(examPage);


            string xpath = @"//table";            ////table";//[width=""100%""]";//tr[@class!=""greyType2""]";

            HtmlNodeCollection nodes = document.DocumentNode.SelectNodes(xpath);

            foreach (var node in nodes)
            {
                var children = node.SelectNodes(xpath);
                foreach (var child in children)
                {
                    Console.WriteLine(child.OuterHtml);
                }
            }

            //HtmlNode current = document.DocumentNode;
            //List<HtmlNode> tables = new List<HtmlNode>();
            //foreach (var node in current.ChildNodes)
            //{
            //	if (node.NodeType == HtmlNodeType.Element && node.
            //}
        }