title: Better way to retrieve columns data from a Web table using webdriver
body: <p>I'm trying to fetch data from a table into <code>List&lt;List&lt;String&gt;&gt;</code> in java. Below code works. But it is taking 20+ seconds to fetch data. Would like to know is there any other <code>faster</code> way to fetch data from table?</p>
  
  <pre><code>List&lt;WebElement&gt; rows = table.findElements(By.xpath(".//tbody//tr//td//.."));
  List&lt;ArrayList&lt;String&gt;&gt; rowsData = new ArrayList&lt;ArrayList&lt;String&gt;&gt;();
  
  for(WebElement row:rows){
      List&lt;WebElement&gt; rowElements = row.findElements(By.xpath(".//td"));
  
      ArrayList&lt;String&gt; rowData = new ArrayList&lt;String&gt;();
  
      for(WebElement column:rowElements){
          rowData.add(column.getText().toString());
      }
  
      rowsData.add(rowData);
  }
  
  return rowsData;
  </code></pre>