locked
How do that to get content as photos by html agility pack?

    Question

  • Source html:

    if (sense_list_item != null)

        {
            foreach (var node2 in sense_list_item)
      {

    var orth = node2.Descendants("span").ToList().FindAll(x => x.GetAttributeValue("class", "").Contains("orth")); var type_translation = node2.Descendants("span").ToList().FindAll(x => x.GetAttributeValue("class", "").Contains("cit cit-type-translation")); if (type_translation != null) { for(int i=0;i<Math.Max(type_translation.Count(),orth.Count());i++) { if(i< orth.Count()) { results.senselist += type_translation[i].InnerText.Trim() + " =>" + orth[i].InnerText.Trim() +" "; } else { results.senselist += type_translation[i].InnerText.Trim() + " "; } } }

    arrays.Add(results);


    I want get all content inside that but don't + string, it must be seperate:

    Ex: results.senselist=type_translation.innertext
    results.orth=orth.innertext

    How to make it???
    "+= type_translation[i].InnerText.Trim() + " =>" + orth[i].InnerText.Trim() +" ";"

    How to make it?

    My code is string + string;

    NO "results.senselist += type_translation[i].InnerText.Trim() + " =>" + orth[i].InnerText.Trim() +" ";"

    How to make to show results as following?

     results.senselist=type_translation.innertext 
    
        results.orth=orth.innertext 

    As results of source html:

    to have, to have got   **⇒ Elle a 2 enfants**. She has 2 children., she has got 2 children   **⇒ Elle a une belle maison.** She has a lovely house., She has got a lovely house.   **⇒ Il a les yeux bleus.** He has blue eyes., He has got blue eyes.   **⇒ Tu as de beaux cheveux**. You have beautiful hair., You have got beautiful hair.   **⇒ Il a beaucoup d'amis.** He has a lot of friends., He has got a lot of friends.

    This bold text part is "results.orth=orth.innertext "

    results.senselist=type_translation.innertext is what's things else.





    Monday, April 20, 2015 6:25 AM

Answers

  • Greg - this isn't a question.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, April 20, 2015 4:01 PM
    Moderator

All replies

  • Greg - this isn't a question.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, April 20, 2015 4:01 PM
    Moderator
  • I have revised this post
    Tuesday, April 21, 2015 1:40 AM