Reputation: 37
I'm trying to parse the xml api response to xml parse. This is the code
from xml.dom import minidom
response = requests.post(url, data=request_xml.encode('utf8'), headers=headers)
xmldoc = minidom.parse(response.content)
But I'm not able to pass the response object. instead of response object if i pass xml file it works correctly. xmldoc = minidom.parse('exmple.xml') I want to parse the response object.
Can anyone please help me with this. I'm very greatful. thank you soo much in advance
Upvotes: 0
Views: 673
Reputation:
Try, minidom.parseString
xmldoc = minidom.parseString(response.content)
Upvotes: 1