selectnodes problem

Topics: Developer Forum
Nov 2, 2014 at 2:39 PM
Edited Nov 5, 2014 at 2:57 PM
I'm trying to parse html page(http://news.tut.by/politics/)
using this code
            string htmlPage = "";
        
            using (var client = new HttpClient())
            {
                htmlPage = await client.GetStringAsync("");
            }
     
            HtmlDocument page = new HtmlDocument();
            page.LoadHtml(htmlPage);

            List<NewsHeader> innerList = new List<NewsHeader>();

            foreach (var all_li in page.DocumentNode.SelectNodes("//div[@class='list_category m-s_comment m-s_head m-s_time']//ul[@class='b-lists']//li[@class='lists__li ni']"))
            {
                NewsHeader header = new NewsHeader();
                header.image = all_li.SelectSingleNode(".//div[@class='media']//a//img").Attributes["src"].Value;
                header.title = all_li.SelectSingleNode(".//div[@class='wrap_fix']//a").InnerText.Trim();
                header.pubDate = all_li.SelectSingleNode(".//div[@class='block-meta']//ul//li").InnerText.Trim();
                header.link = all_li.SelectSingleNode(".//div[@class='wrap_fix']//a").Attributes["href"].Value;
                innerList.Add(header);
            }
the problem is that when i run it, the following string gets only first 6 elements
page.DocumentNode.SelectNodes("//div[@class='list_category m-s_comment m-s_head m-s_time']//ul[@class='b-lists']//li[@class='lists__li ni']")
but when i put this (//div[@class='list_category m-s_comment m-s_head m-s_time']//ul[@class='b-lists']//li[@class='lists__li ni']) in HAP testbed program,the program gets all the 27 elements

So i can't find why does this problem occur.
P.S. using it in c# in windows phone application