3 ms·
# This doesn't use Beautiful Soup (yet) because there's a Berlios case # BS may not be able to cope with. We'll check sometime. I wonder if he's having issue
by yesimahuman 17y ago
# This doesn't use Beautiful Soup (yet) because there's a Berlios case
# BS may not be able to cope with. We'll check sometime.
I wonder if he's having issues with 3.1.0 which frankly never worked for me (as clearly stated by the BS developer) when used on normal web sites.
- jmillikin 17y agoHave 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/