Skip to content

Commit

Permalink
[FIX] regex
Browse files Browse the repository at this point in the history
  • Loading branch information
corredato committed Jul 12, 2024
1 parent b65742c commit 0ee603e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/erpbrasil/edoc/resposta.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def __init__(self, webservice, raiz, xml, retorno, resposta):

def analisar_retorno_raw(operacao, raiz, xml, retorno, classe):
retorno.raise_for_status()
match = re.search("<soap:Body>(.*?)</soap:Body>", retorno.text.replace("\n", ""))
pattern = r"<[a-zA-Z0-9:]Body.?>(.*?)</[a-zA-Z0-9:]*Body>"
match = re.search(pattern, retorno.text.replace("\n", ""))
if match:
xml_resposta = match.group(1)
xml_etree = etree.fromstring(xml_resposta)
Expand Down

0 comments on commit 0ee603e

Please sign in to comment.