From cffdbe8ea279cc0a847b6a3f2566493c371cbc93 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Tue, 27 Dec 2022 16:24:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Doldtoons=E7=AD=BE=E5=88=B0?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt_site/UtilityTool.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pt_site/UtilityTool.py b/pt_site/UtilityTool.py index cb1c5e6..b4e65eb 100644 --- a/pt_site/UtilityTool.py +++ b/pt_site/UtilityTool.py @@ -1167,12 +1167,13 @@ class PtSpider: or '签到已得' in status \ or '已签到' in status \ or '已经签到' in status \ - or '签到成功' in status: + or '签到成功' in status \ + or 'Success' in status: pass else: return CommonResponse.error(msg='签到失败!') title_parse = self.parse(res, '//td[@id="outer"]//td[@class="embedded"]/h2/text()') - content_parse = self.parse(res, '//td[@id="outer"]//td[@class="embedded"]/table/tr/td//text()') + content_parse = self.parse(res, '//td[@id="outer"]//td[@class="embedded"]/table//td//text()') if len(content_parse) <= 0: title_parse = self.parse(res, '//td[@id="outer"]//td[@class="embedded"]/b[1]/text()') content_parse = self.parse(res, '//td[@id="outer"]//td[@class="embedded"]/text()[1]') @@ -1187,6 +1188,7 @@ class PtSpider: content = ''.join(content_parse).strip().replace('\n', '') # logger.info(content) message = title + ',' + content + logger.info(f'{my_site} 签到返回信息:{message}') if len(message) <= 1: message = datetime.today().strftime('%Y-%m-%d %H:%M:%S') + '打卡成功!' # message = ''.join(title).strip()