diff --git a/utils/HtmlUtils.py b/utils/HtmlUtils.py index e211f3b..98c0454 100644 --- a/utils/HtmlUtils.py +++ b/utils/HtmlUtils.py @@ -75,8 +75,11 @@ class htmlUtils: url_text = res if type == "json": #url_text = res.json() - cls.saveHtml(curl,res.text) - return json.loads(res.text) + try: + cls.saveHtml(curl,res.text) + return json.loads(res.text) + except: + return None if type == None: url_text = html.fromstring(res.text) cls.saveHtml(curl,res.text)