From 49290643fba55800f2e1b74e6761b6ed149af02d Mon Sep 17 00:00:00 2001 From: ngfchl Date: Sun, 25 Dec 2022 13:27:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96U2=E7=AD=BE=E5=88=B0=E8=BF=94?= =?UTF-8?q?=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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pt_site/UtilityTool.py b/pt_site/UtilityTool.py index f1d3056..0d6db03 100644 --- a/pt_site/UtilityTool.py +++ b/pt_site/UtilityTool.py @@ -669,8 +669,8 @@ class PtSpider: method=site.sign_in_method, data=data, ) - logger.info(response.text.encode('utf8')) - if "window.location.href = 'showup.php';" in response.text.encode('utf8'): + logger.info(response.content.decode('utf8')) + if "window.location.href = 'showup.php';" in response.content.decode('utf8'): result = self.send_request( my_site=my_site, url=url, @@ -678,7 +678,8 @@ class PtSpider: title = self.parse(result, '//h2[contains(text(),"签到区")]/following-sibling::table//h3/text()') content = self.parse( result, - '//td/span[@class="nowrap"]/a[contains(@href,"userdetails.php?id={}")]/parent::span/following-sibling::b[2]/text()'.format( + '//td/span[@class="nowrap"]/a[contains(@href,"userdetails.php?id={}")]' + '/parent::span/following-sibling::b[2]/text()'.format( my_site.user_id ) )