4 ms·
If I'm reading those two files correctly, he's trying to use BeautifulSoup, but doesn't ever import it from anywhere... I think the snotty kid/poor fool was rig
by tghw 17y ago
If I'm reading those two files correctly, he's trying to use BeautifulSoup, but doesn't ever import it from anywhere... I think the snotty kid/poor fool was right, this is poor code.
- jgrahamc 17y agoNo, it is imported from htmlscrape.py http://svn.gna.org/viewcvs/forgeplucker/trunk/forgeplucker/htmlscrape.py?rev=53&view=markup http://svn.gna.org/viewcvs/forgeplucker/trunk/forgeplucker/h...
- 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/