Python Beautiful soup tag for table td
<td class="result" valign="top" colspan="3">
At the moment, the following does not work:
for header in soup('table', 'td .result'):
Getting error:
HTMLParser.HTMLParseError: malformed start tag
Python Beautiful soup tag for table td
<td class="result" valign="top" colspan="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.