用beautiful soup从html代码中提取tabel

2024-10-03 17:27:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我有如下html:

<table class="tbOdpis" width="100%" cellspacing="0"> <tbody> <tr> <td class="csEmptyLine" colspan="100" width="100%"></td> </tr> <tr> <td class="csTTytul" colspan="100" width="100%">OZNACZENIE KSIĘGI WIECZYSTEJ</td> </tr> </tbody> </table>

我尝试用以下代码提取此表:

soup.findAll('table')[1]

一切都会好的,除非我只收到这个:

<table cellspacing="0" class="tbOdpis" width="100%"> <td class="csEmptyLine" colspan="100" width="100%"></td> </table>

为什么第二排不见了?你知道吗


Tags: htmltablewidthtrclasstdgiksi