网址中的XML没有返回完整的XML

时间:2019-01-24 13:53:58

标签: c# .net xml

我正在尝试以XML格式返回站点地图。

它似乎有效,但只返回实际XML的2/3

            using (var client = new WebClient())
            {                
                string html = client.DownloadString("https://int.lowrance.com/en-au/sitemap.xml");               
                var doc = new HtmlDocument();
                doc.LoadHtml(html);

                var ach = doc.DocumentNode.SelectNodes("//loc");

                foreach (var node in ach)
                {
                    var loc = doc.DocumentNode.SelectNodes("//loc");
                    var inner = node.InnerHtml;    
                } 
            }

我也尝试过

            XmlDocument doc1 = new XmlDocument();                
            doc1.Load("https://www.lowrance.com/en-au/sitemap.xml");

但是在调试时我得到了相同的结果。

起初我以为这是行得通的,然后意识到它并没有返回所有XML,所以不胜感激。

0 个答案:

没有答案