title: Using Selenium and python to save a table
body: <p>I'm trying to use Selenium with Python to store the contents of a table. My script is as follows:</p>
  
  <pre><code>import sys
  import selenium
  from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  
  driver = webdriver.Firefox()
  driver.get("http://testsite.com")
  
  value = selenium.getTable("table_id_10")
  
  print value
  
  driver.close()
  </code></pre>
  
  <p>This opens up the webpage I am interested in, and then should save the contents of the table that I want. I've seen the syntax in this <a href="https://stackoverflow.com/questions/4903144/using-seleniums-python-api-how-do-i-get-the-number-of-rows-in-a-table">question</a> which uses <code>browser.get_table()</code>, but the beginning of that program begins with <code>browser=Selenium(...)</code> which I did not understand. I'm not sure what syntax I should be using as <code>selenium.getTable("table_id_10")</code> is incorrect.</p>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>I included a html snippet of the table that I am using:</p>
  
  <pre><code>&lt;table class="datatable" cellspacing="0" rules="all" border="1" id="table_id_10" style="width:70%;border-collapse:collapse;"&gt;
      &lt;caption&gt;
          &lt;span class="captioninformation right"&gt;&lt;a href="Services.aspx" class="functionlink"&gt;Return to Services&lt;/a&gt;&lt;/span&gt;Data
      &lt;/caption&gt;&lt;tr&gt;
          &lt;th scope="col"&gt;Read Date&lt;/th&gt;&lt;th class="numericdataheader" scope="col"&gt;Days&lt;/th&gt;&lt;th class="numericdataheader" scope="col"&gt;Values&lt;/th&gt;
  
      &lt;/tr&gt;&lt;tr&gt;
          &lt;td&gt;10/15/2011&lt;/td&gt;&lt;td class="numericdata"&gt;92&lt;/td&gt;&lt;td class="numericdata"&gt;37&lt;/td&gt;
      &lt;/tr&gt;&lt;tr class="alternaterows"&gt;
          &lt;td&gt;7/15/2011&lt;/td&gt;&lt;td class="numericdata"&gt;91&lt;/td&gt;&lt;td class="numericdata"&gt;27&lt;/td&gt;
      &lt;/tr&gt;&lt;tr&gt;
          &lt;td&gt;4/15/2011&lt;/td&gt;&lt;td class="numericdata"&gt;90&lt;/td&gt;&lt;td class="numericdata"&gt;25&lt;/td&gt;    
  &lt;/table&gt;
  </code></pre>