title: Parsing dl with HtmlAgilityPack
body: <p>This is the sample HTML I am trying to parse with Html Agility Pack in ASP.Net (C#).</p>
  
  <pre><code>&lt;div class="content-div"&gt;
      &lt;dl&gt;
          &lt;dt&gt;
              &lt;b&gt;&lt;a href="1.html" title="1"&gt;1&lt;/a&gt;&lt;/b&gt;
          &lt;/dt&gt;
          &lt;dd&gt; First Entry&lt;/dd&gt;
          &lt;dt&gt;
              &lt;b&gt;&lt;a href="2.html" title="2"&gt;2&lt;/a&gt;&lt;/b&gt;
          &lt;/dt&gt;
          &lt;dd&gt; Second Entry&lt;/dd&gt;
          &lt;dt&gt;
              &lt;b&gt;&lt;a href="3.html" title="3"&gt;3&lt;/a&gt;&lt;/b&gt;
          &lt;/dt&gt;
          &lt;dd&gt; Third Entry&lt;/dd&gt;
      &lt;/dl&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The Values I want are :</p>
  
  <ul>
  <li>The hyperlink -> 1.html</li>
  <li>The Anchor Text ->1</li>
  <li>Inner Text od dd -> First Entry</li>
  </ul>
  
  <p>(I have taken examples of the first entry here but I want the values for these elements for all the entries in the list )</p>
  
  <p>This is the code I am using currently,</p>
  
  <pre><code>var webGet = new HtmlWeb();
              var document = webGet.Load(url2);
  var parsedValues=
     from info in document.DocumentNode.SelectNodes("//div[@class='content-div']")
     from content in info.SelectNodes("dl//dd")
     from link in info.SelectNodes("dl//dt/b/a")
         .Where(x =&gt; x.Attributes.Contains("href"))
     select new 
     {
         Text = content.InnerText,
         Url = link.Attributes["href"].Value,
         AnchorText = link.InnerText,
     };
  
  GridView1.DataSource = parsedValues;
  GridView1.DataBind();
  </code></pre>
  
  <p>The problem is that I get the values for the link and the anchor text correctly but for the inner text of  it just takes the value of the first entry and fills the same value for all other entries for the total number of times the element occurs and then it starts over with the second one. I may not be so clear in my explanation so here's a sample output I am getting with this code:</p>
  
  <pre><code>First Entry     1.html  1
  First Entry     2.html  2
  First Entry     3.html  3
  Second Entry    1.html  1
  Second Entry    2.html  2
  Second Entry    3.html  3
  Third Entry     1.html  1
  Third Entry     2.html  2
  Third Entry     3.html  3
  </code></pre>
  
  <p>Whereas I am trying to get </p>
  
  <pre><code>First Entry      1.html     1
  Second Entry     2.html     2
  Third Entry      3.html     3
  </code></pre>
  
  <p>I am pretty new to HAP and have very little knoweledge on xpath, so I am sure I am doing something wrong here, but I couldn't make it work even after spending hours on it. Any help would be much appreciated.</p>