I have next xml:
<?xml version='1.0' encoding='utf-8'?>
<SOAP:Envelope xmlns:SOAP="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/addressing">
<SOAP:Header>
</SOAP:Header>
<SOAP:Body>
<Server_Reply xmlns="some_url">
<conversionRate>
<conversionRateDetail>
<currency>dollar</currency>
</conversionRateDetail>
</conversionRate>
</Server_Reply>
</SOAP:Body>
</SOAP:Envelope>
It is in reply.txt
. Then I do:
with open('reply.txt', 'r') as f:
reply = f.read()
reply_element = fromstring(reply)
I need to find Server_Reply
element.
When I do:
response = reply_element.find('Body/Server_Reply')
but it returns None. How to do it correct? In the end, I need to get Server_Reply element.