diff --git a/README.md b/README.md index b5d7d77..21a3233 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,7 @@ www的那个地址抓CK,登录后F12点到network,不要用命令document.co 有问题欢迎提pr、issue 更新日志: -2022/11/6 -新增多账号; -报错不停止运行; -倒序评价,优先比较老的订单; +2022/11/6 新增多账号; 报错不停止运行;倒序评价,优先比较老的订单; +2022/11/16 修复有些订单匹配不到pid ; ![image](https://i.postimg.cc/NG6g4pHf/1.jpg) \ No newline at end of file diff --git a/jd_comment.py b/jd_comment.py index 3005f5e..7e9bee6 100644 --- a/jd_comment.py +++ b/jd_comment.py @@ -14,7 +14,7 @@ import logging import os import random import sys -import time +import time,re try: @@ -266,7 +266,7 @@ def sunbw(N, opts=None): opts['logger'].debug('Total loop times: %d', loop_times1) idx = 0 for oname, pid in zip(oname_data, pid_data): - pid = pid.replace('//item.jd.com/', '').replace('.html', '') + pid = re.findall('(?<=jd.com/)[(0-9)*?]+',pid)[0] opts['logger'].info(f'\t开始第{i+1}个订单: {oid}') opts['logger'].debug('pid: %s', pid) opts['logger'].debug('oid: %s', oid)