Retreive ul, li tag which have not class of name.

Topics: Developer Forum
Mar 3, 2015 at 6:03 AM
Image
string id="1-1";
 public async void ExampLoad(string id)
        {
            var httpClient = new HttpClient();
            string srtHtml = await httpClient.GetStringAsync("http://dictionary.cambridge.org/dictionary/british/appeal");
            var htmlDoc = new HtmlDocument();
            htmlDoc.LoadHtml(srtHtml);

            List<Models.EnglishDictionary> arrays = new List<Models.EnglishDictionary>();
            var NewListNodeHtml = htmlDoc.GetElementbyId("entryContent");
            if(NewListNodeHtml!=null)
            {
                var SenseBlock = NewListNodeHtml.Descendants("div").Where(x => x.GetAttributeValue("id", "") == id);
                if(SenseBlock!=null)
                {
                    foreach(var node in SenseBlock)
                    {
                        Dictionaries = new Models.EnglishDictionary();
                        var ul = node.Descendants("div").FirstOrDefault(x => x.GetAttributeValue("class", "") == "extraexamps");
                        if(ul!=null)
                        {
                            Dictionaries.Examp = ul.InnerText.Trim();
                        }
                        arrays.Add(Dictionaries);
                    }
                }
            }
            lstExample1_1.ItemsSource = arrays;
        }
How to get of all ul tags in id 1-1.