try parsing response as utf-8

This commit is contained in:
Evgeny Zinoviev 2021-03-23 02:03:34 +03:00
parent bc07dcbe5e
commit b4f7340c8c

View File

@ -66,6 +66,7 @@ class WebAPI:
def request(self, endpoint: str, data=None):
url = f'http://{self.ip}/api/{endpoint}'
r = requests.get(url, headers=self.headers) if data is None else requests.post(url, data=data, headers=self.headers)
r.encoding = 'utf-8'
soup = BeautifulSoup(r.text, 'lxml-xml')