diff --git a/utils/HtmlUtils.py b/utils/HtmlUtils.py
index 5d3b06b..0d70cf1 100644
--- a/utils/HtmlUtils.py
+++ b/utils/HtmlUtils.py
@@ -31,6 +31,8 @@ class htmlUtils:
res = s.get(curl,stream=True, headers=cls.headers, timeout=20)
if type == "json":
url_text = res.json()
+ if type == "bytes":
+ url_text = res
else:
url_text = html.fromstring(res.text)
except:
@@ -42,10 +44,15 @@ class htmlUtils:
else:
print(f"fail 请求失败:{curl}")
break
- data = { curl : url_text}
- cls.url_data.update(data)
+ if not type == "bytes":
+ data = { curl : url_text}
+ cls.url_data.update(data)
return url_text
+ @classmethod
+ def getBytes(cls, url):
+ return cls.getHTML(url,type="bytes")
+
@classmethod
def getJSON(cls,curl):
return cls.getHTML(curl,type="json")