2 ms·
Have you tried following the instructions on the BeautifulSoup site[1]? The HTML parser it depended on was removed from the Python standard library, and its rep
by jmillikin 17y ago
Have you tried following the instructions on the BeautifulSoup site[1]? The HTML parser it depended on was removed from the Python standard library, and its replacement doesn't work as well at processing bad markup. You should install html5lib[2] and use it for parsing:
import html5lib
from html5lib.treebuilders import getTreeBuilder
parser = html5lib.HTMLParser(tree=getTreeBuilder("beautifulsoup"))
soup = parser.parse(open("mydocument.html"))
[1] http://www.crummy.com/software/BeautifulSoup/3.1-problems.html http://www.crummy.com/software/BeautifulSoup/3.1-problems.ht...
[2] http://code.google.com/p/html5lib/ http://code.google.com/p/html5lib/