html5lib注意到它的最新版本(0.11)有些陈旧。使用Python部分,我有Issue 70和Issue 59中提到的递归问题,但找不到最近稳定的Mercurial版本。
最新提示不好,我从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
我在运行时遇到以下错误:
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)
我在Python 2.5.2上使用它与lxml和BeautifulSoup。