开发者

Python Beautiful soup tag for table td

Python Beautiful soup tag for table td

  <td class="result" valign="top" colsp开发者_开发问答an="3">

At the moment, the following does not work:

for header in soup('table', 'td .result'):

Getting error:

HTMLParser.HTMLParseError: malformed start tag


As noted on their website, HTMLParser is quite fragile. You should use SGMLParser instead, as it's more robust against malformed HTML.

Unfortunately, Python 3.0 has removed SGMLParser from the standard library. See the links above for suggested workarounds, such as using html5lib.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜