From 5e490c0ea796b8708b737f242735eaff310da4ed Mon Sep 17 00:00:00 2001 From: ngfchl Date: Sun, 25 Sep 2022 20:38:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DU2=E7=AD=BE=E5=88=B0=E6=97=B6?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E6=98=AF=E5=90=A6=E7=AD=BE=E5=88=B0=E9=83=A8?= =?UTF-8?q?=E5=88=86=E4=BB=A3=E7=A0=81=E5=87=BA=E9=94=99=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt_site/UtilityTool.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pt_site/UtilityTool.py b/pt_site/UtilityTool.py index 705d6fd..b15f12b 100644 --- a/pt_site/UtilityTool.py +++ b/pt_site/UtilityTool.py @@ -451,7 +451,8 @@ class PtSpider: my_site=my_site, url=url, ) - sign_str = ''.join(self.parse(result, '//a[@href="showup.php"]')) + sign_str = ''.join(self.parse(result, '//a[@href="showup.php"]/text()')) + print(site.name, sign_str) if '已签到' in converter.convert(sign_str): return CommonResponse.success(msg=site.name + '已签到,请勿重复操作!!') req = self.parse(result, '//form//td/input[@name="req"]/@value') @@ -486,12 +487,12 @@ class PtSpider: data=data, ) print(response.content.decode('utf8')) - if 'response.content.decode("utf8")' in response.content.decode('utf8'): + if "window.location.href = 'showup.php';" in response.content.decode('utf8'): return CommonResponse.success(msg='低保签到成功!') else: return CommonResponse.error(msg='签到失败!') except Exception as e: - # raise + raise return CommonResponse.error( status=StatusCodeEnum.WEB_CONNECT_ERR, msg=site.name + str(e) @@ -812,7 +813,7 @@ class PtSpider: else: return CommonResponse.error(msg='请确认签到是否成功??网页返回码:' + str(res.status_code)) except Exception as e: - # raise + raise self.send_text(site.name + '签到失败!原因:' + str(e)) return CommonResponse.error(msg='签到失败!' + str(e))