diff --git a/pysuez/client.py b/pysuez/client.py index 9273e69..a71b8ba 100644 --- a/pysuez/client.py +++ b/pysuez/client.py @@ -55,7 +55,8 @@ def _get_token(self): headers['Cookie'] += "; " headers['Cookie'] += key + "=" + response.cookies[key] - phrase = re.compile('_csrf_token" value="(.*)"/>') + # Feb 2023 : SUEZ changed token name and encoding. Changed regex accordingly + phrase = re.compile('.u0022csrfToken.u0022.u003A.u0022(.*).u0022,') result = phrase.search(response.content.decode('utf-8')) self._token = result.group(1) self._headers = headers