用MS生成了XML的规则
但是用 bbsExtra.setXsltFromFile("xslt_bbs.xml")
会提示报错
result = bbsExtra.extract(doc) # 调用extract方法提取所需内容
File "/root/gooseeker.py", line 44, in extract
xslt_root = etree.XML(self.xslt)
File "src/lxml/lxml.etree.pyx", line 3192, in lxml.etree.XML (src/lxml/lxml.etree.c:78763)
File "src/lxml/parser.pxi", line 1843, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:118282)
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
环境Centos7 Python34
|
|
|
|
|
共 3 个关于本帖的回复 最后回复于 2017-5-1 09:46