This is what my HTML looks like :
<table cellspacing="0" cellpadding="0" class="list04" style="width:704px;">
<td class="txt"><img src="img/1001.gif" /></td>
<td>
<div>string1</div>
<div>
string2</div>
</td>
<td><div class="name">string3</div>
</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td></td>
<td class="txt"><img src="img/1002.gif" /></td>
<td>
<div>string4</div>
<div>
string5</div>
</td>
<td><div class="name">string6</div>
</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td></td>
</table>
I want to extract strings (string1 to string6) with Beautiful soup.
Can anyone answer me how to do this?
** there are so many <div>s in the rest of HTML and i don’t need them all.
I want to extract strings between <td class="txt"> and </td>
If that is in the string
html, usewhich will print out: