mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
清除获取的分享率中的异常字符
This commit is contained in:
@@ -1771,12 +1771,12 @@ class PtSpider:
|
||||
if not ratio:
|
||||
ratio = ''.join(
|
||||
details_html.xpath('//font[@class="color_ratio"][1]/following-sibling::font[1]/text()[1]'))
|
||||
if ratio.count('上传量') > 0:
|
||||
if ratio.count('上传量') > 0 and site.url == 'https://totheglory.im/':
|
||||
# 适配TTG inf分享率
|
||||
ratio = ''.join(
|
||||
details_html.xpath(
|
||||
'//font[contains(text(),"分享率 ")][1]/following-sibling::text()[1]')) \
|
||||
.replace('\xa0', '').strip()
|
||||
.replace('\xa0', '').replace('.', '').strip()
|
||||
# 分享率告警通知
|
||||
logger.info('ratio:{}'.format(ratio))
|
||||
if ratio and ratio != 'inf' and float(ratio) <= 1:
|
||||
|
||||
Reference in New Issue
Block a user