首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

请问怎么用BeautifulSoup快速定位到这一句

2013-01-05 
请教如何用BeautifulSoup快速定位到这一句:trtd colspan2span classfont12pxDisplay name a

请教如何用BeautifulSoup快速定位到这一句:


<tr>
<td colspan="2"><span class="font12px">&nbsp;&nbsp;Display name <a href='http://test.com/SoftName.html' title='virus'><b>SoftName</b></a> find 0 soft.</span></td>
</tr>

如何通过tr标签或者td标签快速定位到find 0 soft这段字符呢?
soup.findAll("td", ... )  这后面不知道咋填,求助
[解决办法]
不好意思,写错了,不是:
soup.findAll(id="td", attrs={"colspan":"2"});

是:
soup.findAll(name="td", attrs={"colspan":"2"});

热点排行