Question

html5lib notes that it's latest release (0.11) is somewhat old. Using the Python portion, I have recursion problems as noted in Issue 70 and Issue 59 but can't find a recent Mercurial revision that is stable.

The latest tip is no good, I got the following error from python setup.py install:

byte-compiling build/bdist.linux-x86_64/egg/html5lib/treewalkers/_base.py to _base.pyc
  File "build/bdist.linux-x86_64/egg/html5lib/treewalkers/_base.py", line 40
    "data": []}
         ^
SyntaxError: invalid syntax

And I get the following errors at runtime:

    soup = parser.parse(page.read())
  File "build/bdist.linux-x86_64/egg/html5lib/html5parser.py", line 165, in parse
  File "build/bdist.linux-x86_64/egg/html5lib/html5parser.py", line 144, in _parse
  File "build/bdist.linux-x86_64/egg/html5lib/html5parser.py", line 454, in processDoctype
TypeError: insertDoctype() takes exactly 4 arguments (2 given)

I'm using it on Python 2.5.2 with lxml and BeautifulSoup.

Was it helpful?

Solution

As of January 2010, it looks like version 0.90 is what you want:

http://code.google.com/p/html5lib/downloads/list

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top