0

I am using Python request method for sending a Post API request. The content of the response obtained is in the following format:

<RESPONSE>
<DATE></DATE>
<CODE></CODE>
</RESPONSE>

How to proceed in parsing the response if I want to get the code from the response?

abc123
  • 1
  • 1

1 Answers1

0

This looks like XML; parse it using an XML library?

Depending on the situation, you could also ignore that it's XML and just pluck out the pieces that you need; this will be particularly useful if the response is not in fact valid XML, but risks summoning eldritch horrors.

Jiří Baum
  • 6,697
  • 2
  • 17
  • 17