title: How to select all text in table cells in Selenium
body: <p>Trying to write a simple script to give me all the cell contents of a table.  </p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  
  url = 'http://127.0.0.1/html5css3'
  driver = webdriver.Firefox()
  driver.get(url)
  
  table = driver.find_elements_by_xpath("//td//text()")
  
  for t in table:
      print t
  </code></pre>
  
  <p>I have yet to find a tutorial on xpath syntax that covers from the basics to the advanced.</p>
  
  <p><strong>Sample input:</strong></p>
  
  <pre><code>&lt;table border="1"&gt;
    &lt;tr&gt;
      &lt;td&gt;Product&lt;/td&gt;
      &lt;td&gt;Vehicle&lt;/td&gt;
      &lt;td&gt;Price&lt;/td&gt;
      &lt;td&gt;Rating&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Duration&lt;/td&gt;
      &lt;td&gt;Latex&lt;/td&gt;
      &lt;td&gt;62&lt;/td&gt;
      &lt;td&gt;5&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Super Paint&lt;/td&gt;
      &lt;td&gt;Latex&lt;/td&gt;
      &lt;td&gt;56&lt;/td&gt;
      &lt;td&gt;4&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;A-100&lt;/td&gt;
      &lt;td&gt;Latex&lt;/td&gt;
      &lt;td&gt;48&lt;/td&gt;
      &lt;td&gt;3&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Macropoxy&lt;/td&gt;
      &lt;td&gt;Epoxy&lt;/td&gt;
      &lt;td&gt;62&lt;/td&gt;
      &lt;td&gt;5&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>