title: Get specific Tables with Html Agility Pack
body: <p>I am having trouble getting some specific table's with HTML Agility Pack. I cannot change the actual HTML either, so I can't use other ID"s or Classes or anything.</p>
  
  <p>Can someone show me how I would access each individual table of the following?</p>
  
  <pre><code>&lt;table class="newTable"&gt;
        //table 1 contents
      &lt;table border="0" cellpadding="3" cellspacing="2" width="100%"&gt;
           //table 1 - A contents
      &lt;/table&gt;
  &lt;/table&gt;
  &lt;table border="0" cellpadding="0" cellspacing="0" class="newTable"&gt;
       //table 2 contents
      &lt;table width="100%" border="0" cellspacing="2" cellpadding="0"&gt;
          //table 2 - A contents
      &lt;/table&gt;
      &lt;table width="100%" border="0" cellspacing="2" cellpadding="0"&gt;
         //table 2 - B contents
      &lt;/table&gt;
      &lt;table width="100%" cellspacing="2" cellpadding="0"&gt;
         //table 2 - C contents
      &lt;/table&gt;
  &lt;/table&gt;
  &lt;table&gt;
       //table 3 contents
  &lt;/table&gt;
  </code></pre>
  
  <p>Right now if I were to call the following </p>
  
  <pre><code>HtmlNode table = doc.DocumentNode.SelectSingleNode("//table");
  foreach (var cell in table.SelectNodes("//tr/td"))
  {
       string someVariable = cell.InnerText
  }
  </code></pre>
  
  <p>I would go through everything. I want to be able to access tables differently to correlate where I am storing the data.</p>
  
  <p>I have tried looking at something like </p>
  
  <p><code>doc.DocumentNode.SelectNodes("//table[1]");</code></p>
  
  <p>but using an index does not seem to work, when I try to specify a table with it, it still reads in all tables or none.</p>
  
  <p>Same thing applies to this, it either does not work at all or gets everything.</p>
  
  <pre><code>foreach (var cell in table.SelectNodes("//table").Skip(some_number))
  {
       string someVariable = cell.InnerText
  }
  </code></pre>
  
  <p>I am using the NuGet package of HTML Agility Pack 1.4.9</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>My attempt to get ONLY Table 1 - A's contents. Both give null or endcodingfound exceptions. </p>
  
  <p><code>HtmlNode table = doc.DocumentNode.SelectSingleNode("//table/tr/td/table[1]");</code></p>
  
  <p><code>HtmlNode table = doc.DocumentNode.SelectSingleNode("//table[1]/tr/td/table[1]");</code></p>