From bf710423d9ce79fa1399220a5a1cba939ac04988 Mon Sep 17 00:00:00 2001 From: wuitenye Date: Mon, 18 Nov 2024 16:25:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BB=B6=E6=97=B6=E5=BA=94?= =?UTF-8?q?=E5=AF=B9=E5=8F=8D=E6=89=92=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E5=8C=B9=E9=85=8D=E7=9A=84=E8=BE=B9=E7=95=8C=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/RequestUtil.py | 2 ++ util/ToolsUtil.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/util/RequestUtil.py b/util/RequestUtil.py index a3d7b3e..c19e6a6 100644 --- a/util/RequestUtil.py +++ b/util/RequestUtil.py @@ -1,4 +1,5 @@ import re +import time from tqdm import tqdm import util.LoginUtil as Login import requests @@ -62,6 +63,7 @@ def get_message(start, count): headers=headers, timeout=(5, 10) # 设置连接超时为5秒,读取超时为10秒 ) + time.sleep(5) except requests.Timeout: print("请求超时") return None diff --git a/util/ToolsUtil.py b/util/ToolsUtil.py index 8578998..555ade0 100644 --- a/util/ToolsUtil.py +++ b/util/ToolsUtil.py @@ -243,8 +243,8 @@ def get_content_from_split(content): return content_split[1].strip() if len(content_split) > 1 else content.strip() -# 判断两个字符串是否存在互相包含的情况 +# 判断两个字符串是否相等 def is_any_mutual_exist(str1, str2): str1 = get_content_from_split(str1) str2 = get_content_from_split(str2) - return str1 in str2 or str2 in str1 + return str1 == str2