From 0ee603e8f5a4cc304a1db1cbf4f5602d81bda6cd Mon Sep 17 00:00:00 2001 From: Bruno Date: Wed, 10 Jul 2024 18:19:59 -0300 Subject: [PATCH] [FIX] regex --- src/erpbrasil/edoc/resposta.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/erpbrasil/edoc/resposta.py b/src/erpbrasil/edoc/resposta.py index 347ea24..543d81d 100644 --- a/src/erpbrasil/edoc/resposta.py +++ b/src/erpbrasil/edoc/resposta.py @@ -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("(.*?)", retorno.text.replace("\n", "")) + pattern = r"<[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)