How do that to get ul tag on html agility pack???

How to get of all  ul tags in id 1-1.
Here my code:
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;

Hi Greg,
In general I would recommend you to ask question at
http://htmlagilitypack.codeplex.com/ for a better support on third party library, thanks for your understanding.
Additionally I found some discussion:
http://stackoverflow.com/questions/28199504/retrieve-ul-li-tags-with-using-html-agility-pack, the answer contains a workable code for how to find tag by html agility pack.
--James
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Plz help to get the tag of html file

    hi
    I wants to convert the HTML file into PDF file dynamically.
    So first i wants to get the tag of html file when we pass the path of html file.
    so how i do this plz help me.

    Plz Tell me how I get the HTML Tag through the java code.

  • HOw to get selection node h2 tag on http agility pack

    <div id="content">
    <div class="sense-block" id="1-1>
    <h2>
    <span class="hw">appear</span>
    <span class="posgram">
    <span class="pos" title="A word that describes an action, condition or experience.">verb</span>
    </span>
    <span class="guideword" title="Guide word: helps you find the right meaning when a word has more than one meaning">
    (BE PRESENT)
    </span>
    </h2>
    <div class="sense-body">
    <span class="def-block">
    <span class"def-body">
    <span class"examp"></span>
    <span class"examp"></span>
    </span>
    </span>
    <span class="def-block>
    <span class="def-body">
    <span class"examp"></span>
    <span class"examp"></span>
    </span>
    </span>
    </div>
    </div>
    <div class="sense-block" id="1-2>
    <h2></h2>
    <div class="sense-body">
    <span class="def-block"></span>
    <span class="def-block></span>
    </div>
    </div>
    </div>
    var newsListNodehtml = htmlDoc.GetElementbyId("1-1");
    if(newsListNodehtml!=null)
    var senseblock = newsListNodehtml.Descendants("span").Where(x => x.GetAttributeValue("class", "") == "def-block");
    if(senseblock!=null)
    foreach(var node in senseblock)
    Dictionaries = new Models.EnglishDictionary();
    var title = node.Descendants("span").FirstOrDefault(x => x.GetAttributeValue("class", "") == "def");
    var examp = node.Descendants("span").FirstOrDefault(x => x.GetAttributeValue("class", "") == "def-body");
    //Dictionaries.Symbol = "/Photos/glasses-50.png";
    if (title != null)
    Dictionaries.Description = title.InnerText.Trim();
    if (examp != null)
    Dictionaries.Examp = examp.InnerText.Trim();
    var hw = node.Descendants("span").FirstOrDefault(x => x.GetAttributeValue("class", "") == "hw");
    var prsgram = node.Descendants("span").FirstOrDefault(x => x.GetAttributeValue("class", "") == "posgram");
    var word = node.Descendants("span").FirstOrDefault(x => x.GetAttributeValue("class", "") == "guideword");
    if (hw != null)
    Dictionaries.Word = hw.InnerText.Trim();
    if (word != null)
    Dictionaries.GuideWord = word.InnerText.Trim();
    if (prsgram != null)
    Dictionaries.Grammar = prsgram.InnerText.Trim();
    //Dictionaries.Phrase=pharsel.InnerText;
    arrays.Add(Dictionaries);
    <div id="x_x_1-1>">
    var senseblock = newsListNodehtml.Descendants("span").Where(x => x.GetAttributeValue("class", "") == "def-block");
    So, senseblock will not be have <h2> tag. Of couse that results is null to (foreach will be play two time and getting def-block two times"
     But If I changed It(senseblock ) to 
              var newsListNodehtml = htmlDoc.GetElementbyId("content"); // content is contain all tag
                if(newsListNodehtml!=null)
                    var senseblock = newsListNodehtml.Descendants("span").Where(x => x.GetAttributeValue("class", "") == "sense-block");
    Then  foreach that just play the def-block once time.
    Note: I'm still want get all of h2 tag and def-block(two time because of having 2 div def-block tag)in id 1-1. How???

    Thanks, I figured out this my ways to solve it.
    I want ask you: How to return Lis<> (async). 
    Ex:
    public async void loaddata(string id)
    var httpClient = new HttpClient();
    var 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 newsListNodehtml = htmlDoc.GetElementbyId("entryContent");
    if (newsListNodehtml != null)
    var senseblock = newsListNodehtml.Descendants("div").Where(x => x.GetAttributeValue("id", "") == id);
    if (senseblock != null)
    foreach (var node in senseblock)
    Dictionaries = new Models.EnglishDictionary();
    var def = node.Descendants("span").FirstOrDefault(x => x.GetAttributeValue("class", "") == "def");
    var examp = node.Descendants("span").FirstOrDefault(x => x.GetAttributeValue("class", "") == "def-body");
    //Dictionaries.Symbol = "/Photos/glasses-50.png";
    if (def != null)
    Dictionaries.Description = def.InnerText.Trim();
    if (examp != null)
    Dictionaries.Examp = examp.InnerText.Trim();
    var hw = node.Descendants("span").FirstOrDefault(x => x.GetAttributeValue("class", "") == "hw");
    var prsgram = node.Descendants("span").FirstOrDefault(x => x.GetAttributeValue("class", "") == "posgram");
    var word = node.Descendants("span").FirstOrDefault(x => x.GetAttributeValue("class", "") == "guideword");
    if (hw != null)
    Dictionaries.Word = hw.InnerText.Trim();
    if (word != null)
    Dictionaries.GuideWord = word.InnerText.Trim();
    if (prsgram != null)
    Dictionaries.Grammar = prsgram.InnerText.Trim();
    arrays.Add(Dictionaries);
    else
    // error = "No data";
    Listview.itemsource=arrays;
    I want on ousite it will called back into "itemsource" of lisview.
    Ex:Listview.itemsource=loaddata("1-1");
    How???

  • Index file share with pictures - how to get the "Tag" property as refiner?

    Hi,
    I'm indexing a folder in file share and in the windows explorer view i gave values to the "Tags" property.
    Now i want to set it as refiner in search results. I see that SharePoint gets the properties of: file name, size, picture height, picture width, author... how to get also the properties of Tags? and Dimensions?
    keren tsur

    Hi keren,
    According to your description, my understanding is that you want to add some refiners based on pictures’ properties in SharePoint 2013 Search.
    Firstly, do a full crawl for the content cource.
    For the ‘Tags’ refiner, go to the results page, click on edit page and edit the refiners web part, then choose the Choose Refiners picker. Now add the TAGS field to the right hand column.
    More information, please refer to the link:
    http://social.technet.microsoft.com/wiki/contents/articles/23690.sharepoint-metadata-tag-refiners-not-displaying-in-sharepoint-2013office-365-search.aspx
    SharePoint indexes an item based on list/library columns. However, for the Dimensions property of pictures, SharePoint library cannot retrieve the property from pictures . So when crawling, the property cannot be crawed as a crawled property, you are not
    able to add it as a refiner in Search. When you use Picture Library, there are Picture Size, Picture Width and Height columns, you can create refiners based on these three columns. You can check them in Crawled properties(CA->Search Service Application->Seach
    Schema).
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Lightroom is not saving metadata. I have done several things to save and I still get the tag that states is is not saved. I have also created 2 smart collections. One showing metadata has been changed and one showing metadata is not up to date. No matter

    Lightroom is not saving metadata. I have done several things to save and I still get the tag that states is is not saved. I have also created 2 smart collections. One showing metadata has been changed and one showing metadata is not up to date. No matter what I do it is not showing in LR that it is saved. I spent 2 days with Seth Resnick trying to correct this and we re created my catalog. It was ok, until I imported new images and same problem. Now I have a new problem, when I bring image to PS it saves it but does not bring back to LR. Am I the only one out there who has this problem?

    See:
    How to use multiple iPods, iPads, or iPhones with one computer
    What is the best way to manage multiple...: Apple Support Communities

  • How to get the tag name of HTMLDocument?

    I am now using JEditorPane to display and edit a html file.
    My code is like this:
    kit = new HTMLEditorKit();
    doc = (HTMLDocument) (kit.createDefaultDocument());
    editor.setEditorKit(kit);
    editor.setDocument(doc);
    editor.setContentType("text/html; charset=utf-8");
    editor.getDocument();
    [editor is the class JEditorPane,  doc is HTMLDocument,  kit is HTMLEditorKit]
    When a user clicks on the pane, it's easy to me to get the caret position. However, how can I get the tag?
    For example,
    <p><font class="book">I am a boy.</font> Hello! </p>
    On the pane, the position between "I am a boy" is clicked, I want to get the name of the tag - "font". Moreover, how can I get the class - "book" also?
    Moreover, can I get the <p> tag also?
    Many Thanks!
    Stephen

    Hi Stephen,
    is it possible to get the EditorKit from the EditorPane and then get the ViewFactory for the editor kit.
    Since u have the some tags of the elements hardcoded in the HTMLEditorKit.HTMLFactory it will be handy i guess.
    Let me know whether it helped or not so that either same method be approached or some other has to be tried.
    Cheers,
    Nagaraj

  • How to get the tag name into javascript

    Hi,
    Is there any way to get the tag name into java script when user clicks on.
    For eg: if i use netui:anchor tag, how can I pass the tag id to the javascript when user clicks on the link using onClick attribute. This tag id needs to be evaluated at run time.
    Ex code is given below.
    function fun1(){
    // how to get the tag name;
    <%
    String st="hai";
    %>
    <netui:anchor action="x" onClick="fun1()" tagId="<%=st%>>
    I want to get this tagId (st) to the java script function fun1() when user clicks on this link. How can I do that. can you please help in this issue.
    Thanks,
    Satish.

    Hi,
    You can set the java variable as a js variable at run time:
    <script>
    var anchorName = <%=getNetuiTagName%>;
    function fun1()
    var anchorID = getNetuiTagName(anchorName);
    alert(anchorID);// this will show the rendered ID for the anchor specified
    </script>
    this works because the jsp variable will be rendered before the js.
    Thanks,
    Steve

  • I downloaded a new version of firefox. It said it had problems with my norton toolbar and now it doesn't feature it in the window. I'm not that comp savvy. How do I either get the Norton toolbar up or go back to the old firefox? Thank you.

    I downloaded a new version of firefox. It said it had problems with my norton toolbar and now it doesn't feature it in the window. I'm not that comp savvy. How do I either get the Norton toolbar up or go back to the old firefox? Thank you.

    Please authorize ADE 3 with same credentials that you used with older version of ADE

  • How to get the values from html:select? tag..?

    i tried with this, but its not working...
    <html:select styleClass="text" name="querydefs" property="shortcut"
                 onchange="retrieveOptions()" styleId="firstBox" indexed="true">
    <html:options collection="advanced.choices" property="shortcut" labelProperty="label" />
    </html:select>
                        <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>

    <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>This java script is not working at all..its not printing anything in document.write();
    This is code..
    <td class="rowcolor1" width="20%">
    <html:select styleClass="text" name="querydefs" property="shortcut"
                             onchange="retrieveSecondOptions()" styleId="firstBox"
                             indexed="true">
                             <html:options collection="advanced.choices" property="shortcut"
                                  labelProperty="label"  />
                        </html:select>i tried with this also. but no use..i'm not the getting the seleced option...
    function retrieveOptions(){
    firstBox = document.getElementById('firstBox');
                             if(firstBox.selectedIndex==0){
          return;
        selectedOption = firstBox.options[firstBox.selectedIndex].value;
    }actually , how to get the values from <html:select> ...?
    my idea is to know which value is selected from the combo box(<html:select> ) if that value is equal some string i have enable a hyperlink to open a popup window

  • I have the iPhone 4. and when I updated the software to iOS6 My notifications don't make a sound anymore, the only sound that I get are text messages, or Email. I checked to see if the other apps were muted and they weren't. How do I fix this??

    I have the iPhone 4. and when I updated the software to iOS6 My notifications don't make a sound anymore, the only sound that I get are text messages, or Email. I checked to see if the other apps were muted and they weren't. How do I fix this

    You cannot update iPhone 4 to IOS 8.1.2, the highest you can update is IOS 7.1.2.
    Unless you've iPhone 4S (looks similar to iPhone 4)

  • I have Iphone 4s, and the phone will activate itself again. How do I get changed Apple ID on my phone so that I get using the new username and password that is verified? I would like an answer as soon as possible ... Thank you very much.

    I have Iphone 4s, and the phone will activate itself again. This I have verified, but when I shall put this onto my phone, so the phone will not approve the newusername and password. How do I get changed Apple ID on my phone so that I get using the new username and password that is verified? Silly to buy a new phone just for this .... The phone is almost three years old. How long can weexpect this to last? I would like an answer as soon as possible ... Thank you very much.

    It sounds like your device might be in Activation Lock.  Is it asking your to enter in an Apple ID & password, but only showing you the first letter of the email address and then some dots? Example: j•••••@icloud.com?
    If so, do you recognize that email?  Do you have an Apple ID that fits the same format?  If so, then go to www.cloud.com, log in with that Apple ID & password, and see if under Find My iPhone it shows this device.  If so, turn off the device, then remove the device from the list.

  • Save password? how the **** can I get rod of this function!!! every time I sign to a place if I wanted to safe a bloody password I would do that!!!

    save password? how the **** can I get rod of this function!!! every time I sign to a place if I wanted to safe a bloody password I would do that!!!

    It is the same in the latest version 7.0.2. You can shut off the saving and auto filling of passwords by clicking in the menu bar at the top Safari > Preferences and then select Autofill and uncheck the passwords box. Also check the next pane as well.

  • I bought a relative's original iPad. I want to leave the apps on it and add my own pdfs to read. My itunes account is really for my iPod. the computer says that if I "Sync" the iPad will be erase, and become like my iPods. how can I just get my files onto

    I am a first-time iPad owner/user. I bought a relative's original iPad. I want to leave the apps on it and add my own pdfs to read. My itunes account is really for my iPod. iTunes message says that if I "Sync" the iPad will be erase, and become like my iPods. If I make a new iTunes account, would the apps be erased when I tried to use it?
    How can I just get my files onto this iPad, and still have the apps that my relative left there for me?
    Thank you.

    iPads sync to 1 computer only.
    All media and apps are tied to the Apple ID that purchased them.
    Without your relatives ID and password, you cannot update any of the Apps.
    I am pretty certain he is also violating Apples terms of service by giving you the apps.

  • I refuse to pay for a one year automatic subscription for Cosumer report that was charged to my account today without me noticing. How can I cancel that and get reimbursed now?

    I refuse to pay for a one year automatic subscription for Cosumer report that was charged to my account today without me noticing. How can I cancel that and get reimbursed now?
    Patrick

    First turn off auto-renewing subscriptions:
    iTunes Store: Purchasing and managing auto-renewing subscriptions
    Getting a refund won't be as simple. For that you will have to contact iTunes Store Support.

  • HT5616 I have an apple id; but when I try to sign in to iCloud, I get the msg that the apple id is not an iCloud account.  However, apple was able to bill me for my non-existent iCloud account.  How does that happen?

    I have an apple id; but when I try to sign in to iCloud, I get the msg that the apple id is not an iCloud account.  However, apple was able to bill me for my non-existent iCloud account.  How does that happen?

    If you didn't create an iCloud account on an iOS device or Mac, you don't have one.  You can't create an account on a PC.  If you were charged for an iCloud storage upgrade without having an account, contact the Apple online store at the bottom of this page for a refund.

Maybe you are looking for

  • Error while running Import Items program

    Hi All, I am getting error message "Item Catalog Group Descriptive Elements Open Interface import completed successfully for all records in this record set." when i am submitting Import Items Seeded program. data is loaded into master organization su

  • White Screen of Death (or coma, at least)

    Hi everyone, I've been searching all over the place for a couple of days and no solution to the following situation has worked as of yet, so any help would be greatly appreciated. Brand new installation of Snow Leopard on a late 2006 24" white iMac w

  • Need latest  SLD and NWDI version for PI 7.1 EHP1

    Can any one update me the latest  SLD and NWDI version for PI 7.1 EHP1? Kindly provide me the path of implementation guides for SLD, NWDI  which can be used with PI 7.1 EHP1. For PI 7.1 EHP1, can we use the same version of  SLD and  NWDI which used I

  • MC+A  Report

    Hi All, Return Qty is not updating in MC+A Report(Customer Analysis Return), though I have maintained the settings in OVRO,OVRP. Remaining values like Billing qty, Open order value n it's qty are updating. Could u plz help me in this? Regards, Ramu

  • Embedded Video

    Is the Adobe Reader for iPad able to show embedded video in an interaktive PDF? Thanks for information