I have the following xml string and I want to get the value from ReturnCode in Python. How can I easily do this?
I've tried using element tree:
tree = ET.ElementTree(ET.fromstring(response))
root = tree.getroot()
<API>
<Result>
<ErrorCode ErrorType=\"Success\">0</ErrorCode>
<ReturnCode>0</ReturnCode>
</Result>
<API>
The actual response value looks like this-
'<API><Result><ErrorCode ErrorType=\"Success\">0</ErrorCode<ReturnCode>0</ReturnCode></Result><API>'
I would like to be able to use the value from ReturnCode for additional logic.
response, because it's unclear what this variable actually contains.