title: How can I get the first and third td from a table with BeautifulSoup?
body: <p>I am currently using Python and BeautifulSoup to scrape some website data. 
  I'm trying to pull cells from a table which is formatted like so:    </p>
  
  <pre><code>&lt;tr&gt;&lt;td&gt;1&lt;td&gt;&lt;td&gt;20&lt;td&gt;5%&lt;/td&gt;&lt;/td&gt;&lt;/td&gt;&lt;/td&gt;&lt;/tr&gt;
  </code></pre>
  
  <p>The problem with the above HTML is that BeautifulSoup reads it as one tag. I need to pull the values from the first <code>&lt;td&gt;</code> and the third <code>&lt;td&gt;</code>, which would be 1 and 20, respectively. </p>
  
  <p>Unfortunately, I have no idea how to go about this. How can I get BeautifulSoup to read the 1st and 3rd <code>&lt;td&gt;</code> tags of each row of the table?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I figured out the problem. I was using <code>html.parser</code> instead of the default for BeautifulSoup. Once I switched to the default the problems went away. Also I used the method listed in the answer. </p>
  
  <p>I also found out that the different parsers are very temperamental with broken code. For instance, the default parser refused to read past row 192, but <code>html5lib</code> got the job done.So try using <code>lxml</code>, <code>html</code>, and also <code>html5lib</code> if you are having problems parsing the entire table.</p>