title: HTML list comprehension issue while using Beautiful Soup w Python
body: <p>I've narrowed my HTML down and I want to pull the hrefs from each line IF the content following the a tag is past 2010. What's the best way to do this? I'll post my code first, and then the HTML.</p>
  
  <p>Code:</p>
  
  <pre><code>links = [STEM_URL + row.a["href"] for row in divyclass.findAll("td") if row.a and int(row.a.contents[0]) &gt;= 2010]
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;td align="center" class="tableheader" colspan="4" valign="middle"&gt;NBA Drafts&lt;/td&gt;
  &lt;td align="center" class="text" valign="middle"&gt; &lt;/td&gt;
  &lt;td align="center" class="text" valign="middle"&gt; &lt;/td&gt;
  &lt;td align="center" class="text" valign="middle"&gt; &lt;/td&gt;
  &lt;td align="center" class="text" valign="middle"&gt;&lt;a href="/nba_final_draft/2014"&gt;2014&lt;/a&gt;&lt;/td&gt;
  &lt;td align="center" class="text" valign="middle"&gt; &lt;a href="/nba_final_draft/2013"&gt;2013&lt;/a&gt;&lt;/td&gt;
  &lt;td align="center" class="text" valign="middle"&gt; &lt;a href="/nba_final_draft/2012"&gt;2012&lt;/a&gt;&lt;/td&gt;
  &lt;td align="center" class="text" valign="middle"&gt;&lt;a href="/nba_final_draft/2011"&gt;2011&lt;/a&gt;&lt;/td&gt;
  &lt;td align="center" class="text" valign="middle"&gt;&lt;a href="/nba_final_draft/2010"&gt;2010&lt;/a&gt;&lt;/td&gt;
  &lt;td align="center" class="text" valign="middle" width="25%"&gt;&lt;a href="/nba_final_draft/2009"&gt;2009&lt;/a&gt;&lt;/td&gt;
  &lt;td align="center" class="text" valign="middle" width="25%"&gt;&lt;a href="/nba_draft_history/2008.html"&gt;2008&lt;/a&gt;&lt;/td&gt;
  ...
  ...
  &lt;td align="center" class="text" valign="middle" width="25%"&gt;&lt;a href="/nba_draft_history/1989.html"&gt;1980-1989&lt;/a&gt;&lt;/td&gt;
  &lt;td align="center" class="text" valign="middle" width="25%"&gt;&lt;a href="/nba_draft_history/1979.html"&gt;1970-1979&lt;/a&gt;&lt;/td&gt;
  &lt;td align="center" class="text" valign="middle" width="25%"&gt;&lt;a href="/nba_draft_history/1969.html"&gt;1960-1969&lt;/a&gt;&lt;/td&gt;
  &lt;td align="center" class="text" valign="middle" width="25%"&gt;&lt;a href="/nba_draft_history/1959.html"&gt;1947-1959&lt;/a&gt;&lt;/td&gt;
  </code></pre>
  
  <p>As you can see, the issue is that the contents within the a tags start becoming ranges, not integers when we hit 1989, thus messing up our last conditional clause in the list comprehension. What's the best way to go about this?</p>
  
  <p>As of now, my code predictably returns an error <code>ValueError: invalid literal for int() with base 10: '1980-1989'</code></p>