Skip to main content
 首页 » 编程设计

python之html5lib 的哪个版本是稳定的

2025年05月04日12del

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) 

我在带有 lxml 和 BeautifulSoup 的 Python 2.5.2 上使用它。

请您参考如下方法:

截至 2010 年 1 月,看起来版本 0.90 就是您想要的:

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