小编Ser*_*nin的帖子

使用lxml解析HTML时如何保留命名空间信息?

>>> from lxml.etree import HTML, tostring
>>> tostring(HTML('<fb:like>'))
'<html><body><like/></body></html>'
Run Code Online (Sandbox Code Playgroud)

注意标签如何变为<fb:like>简单<like>.

这使得处理包含XFBML和lxml的页面变得更加困难.(同样的事情发生<g:plusone></g:plusone>)

任何帮助表示赞赏.

html python lxml xml-namespaces facebook-like

8
推荐指数
1
解决办法
763
查看次数

标签 统计

facebook-like ×1

html ×1

lxml ×1

python ×1

xml-namespaces ×1