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.
I'm accessing an API that responds in kind with an object type of "xml.etree.ElementTree.Element" So I'm not sure how to covert this tostring?
Your element is an object from the xml library and you are trying to use lxml to stringify it. Either change your code so that your element is an object from the lxml library, or use xml.etree.ElementTree.tostring to stringify it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With