title: XPath, select multiple elements from multiple nodes in HTML
body: <p>I just can't figure this one.</p>
  
  <p>I have to search through all nodes that have classes with <code>"item extend featured"</code> values in it (code below). In those classes I need to select every InnerText of <code>&lt;h2 class="itemtitle"&gt;</code> and <code>href</code> value in it, plus all InnerTexts from <code>&lt;div class="title-additional"&gt;</code>.  </p>
  
  <pre><code>&lt;li class="item extend featured"&gt;
      &lt;div class="title-box"&gt;
          &lt;h2 class="itemtitle"&gt;
              &lt;a target="_top" href="www.example.com/example1/example2/exammple4/example4" title="PC Number 1"&gt;PC Number 1&lt;/a&gt;
          &lt;/h2&gt;
          &lt;div class="title-additional"&gt;
              &lt;div class="title-km"&gt;150 km&lt;/div&gt;
              &lt;div class="title-year"&gt;2009&lt;/div&gt;
              &lt;div class="title-price"&gt;250 €&lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>The output should be something like this:</p>
  
  <pre><code>Title:
  href:
  Title-km:
  Title-year:
  Title-Price:
  --------------
  
  
  Title:
  href:
  Title-km:
  Title-year:
  Title-Price:
  --------------
  </code></pre>
  
  <p>So, the question is, how to traverse through all <code>"item extend featured"</code> nodes in html and select items I need above from each node?</p>
  
  <p>As I understand, something like this should work but it breaks halfway</p>
  
  <p>EDIT: I just noticed, there are ads on the site that share the exact same class and they obviously don't have the elements I need. More problems to think about.</p>
  
  <pre><code>var items1 = htmlDoc.DocumentNode.SelectNodes("//*[@class='item extend featured']");
  
  foreach (var e in items1)
  {
     var test = e.SelectSingleNode(".//a[@target='_top']").InnerText;
     Console.WriteLine(test);
  }
  </code></pre>