title: Getting data from table using Selenium
body: <p>I have a table of fees I am trying to parse through to return data, but it is returning a few blanks before it actually returning the string of data.</p>
  
  <pre><code>&lt;table id="Fees"&gt;
              &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th&gt;Rate Code&lt;/th&gt;
                      &lt;th&gt;Description&lt;/th&gt;
                      &lt;th&gt;Amount&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;
                      &lt;tr&gt;
                          &lt;td class="code"&gt;A1&lt;/td&gt;
                          &lt;td&gt;Charge Type 1&lt;/td&gt;
                          &lt;td class="amount"&gt;$11.20&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td class="code"&gt;C2&lt;/td&gt;
                          &lt;td&gt;Charge Type 2&lt;/td&gt;
                          &lt;td class="amount"&gt;$36.00&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td class="code"&gt;CMI&lt;/td&gt;
                          &lt;td&gt;Cuba Medical Insurance&lt;/td&gt;
                          &lt;td class="amount"&gt;$25.00&lt;/td&gt;
                      &lt;/tr&gt;
              &lt;/tbody&gt;
              &lt;tfoot&gt;
                  &lt;tr&gt;
                      &lt;td colspan="2"&gt;Total:&lt;/td&gt;
                      &lt;td class="amount"&gt;$145.16&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/tfoot&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I return by xpath</p>
  
  <pre><code>private By lst_Fee
  {
      get { return By.XPath("//*[@id=\"Fees\"]/tbody/tr"); }
  }
  </code></pre>
  
  <p>Selenium code:</p>
  
  <pre><code>IList&lt;IWebElement&gt; fees = GetNativeElements(lst_Fee, 5);
  List&lt;string&gt; actual = new List&lt;string&gt;();
  foreach (IWebElement elem in fees)
  {
      actual.Add(GetText(elem, ControlType.Label));
  }
  </code></pre>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li>Is ControlType.Label correct for a table?  I am getting a few blank elems before actually getting to the data.</li>
  <li>If I wanted to separate each Rate, Description and Fee out in each item to make sure the cost adds up to Total correctly, how can I do that?</li>
  </ol>