小编Ant*_*man的帖子

python lxml xml.etree.ElementTree.Element 到字符串不会转换

    type(ikePanProfiles)
    <class 'xml.etree.ElementTree.Element'>

    etree.tostring(ikePanProfiles)
    Traceback (most recent call last):
     File "<input>", line 1, in <module>
     File "src/lxml/etree.pyx", line 3367, in lxml.etree.tostring 
    (src/lxml/etree.c:82622)
    TypeError: Type 'Element' cannot be serialized.
Run Code Online (Sandbox Code Playgroud)

我正在访问一个以“xml.etree.ElementTree.Element”对象类型进行响应的 API,所以我不确定如何隐藏此字符串?

python xml lxml elementtree

3
推荐指数
1
解决办法
5412
查看次数

标签 统计

elementtree ×1

lxml ×1

python ×1

xml ×1