import urllib2
from BeautifulSoup import BeautifulSoup
data = urllib2.urlopen('http://www.NotAvalidURL.com').read()
soup = BeautifulSoup(data)
table = soup("tr", {'class' : 'index_table_in' })
print table[0]
the result is:
<tr id="index_table_12345" class="index_table_in">
<td><a href="/info/12345">string 1</a></td>
<td><a href="/info/12345">string 2</a></td>
<td><a href="/info/12345">string 3</a></td>
<td><a href="/info/12345">string 4</a></td>
<!--td></td-->
</tr>
*the goal is to get only the strings and the index_table_12345 ID, in separate variables to I can save work them out.
so far I haven't been able to do so, the class documentation is pretty tight...
... any suggestions?
thank you!