From db6761aa32352d152c3ffe64bc9719e524a8f013 Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Mon, 9 Jan 2023 21:51:00 +0800 Subject: [PATCH] fix --- utils/HtmlUtils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)