html5lib 注意到这是最新版本(0.11)有些古老。使用Python部分,我有递归问题 第70期问题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使用它。

有帮助吗?

解决方案

截至2010年1月,您想要的是0.90版:

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top