Selenium Webdriver - Fetching column from a data table using Java 8
<p>I am trying to grab a column from a data table. 
Here is my table to use as an example, what I am looking for is to extract the Firstname from the table. </p>

<pre><code>&lt;table style="width:100%"&gt;
  &lt;tr&gt;
    &lt;th&gt;Firstname&lt;/th&gt;
    &lt;th&gt;Lastname&lt;/th&gt; 
    &lt;th&gt;Age&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td class="abc"&gt;Jill&lt;/td&gt;
    &lt;td class="abc"&gt;Smith&lt;/td&gt; 
    &lt;td class="abc"&gt;50&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td class="abc"&gt;Eve&lt;/td&gt;
    &lt;td class="abc"&gt;Jackson&lt;/td&gt; 
    &lt;td class="abc"&gt;94&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>How can i modify the code below to give me this result:</p>

<pre><code>Jill
Eve 


WebElement table = driver.findElement(By.id("searchResultsGrid"));

// Now get all the TR elements from the table
List&lt;WebElement&gt; allRows = table.findElements(By.tagName("tr"));
// And iterate over them, getting the cells
for (WebElement row : allRows) {
    List&lt;WebElement&gt; cells = row.findElements(By.tagName("td"));
    for (WebElement cell : cells) {
        System.out.println("content &gt;&gt;   " + cell.getText());
    }
}
</code></pre>