From 3b2e6cec2f2854496ca688db669d5769a8ccdfb4 Mon Sep 17 00:00:00 2001 From: dylan <58234511@qq.com> Date: Sun, 6 Nov 2022 18:47:45 +0800 Subject: [PATCH] 1 --- README.md | 5 +++-- jd_comment.py | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fb67319..b5d7d77 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ www的那个地址抓CK,登录后F12点到network,不要用命令document.co 更新日志: 2022/11/6 -新增多账号, -报错不停止运行 +新增多账号; +报错不停止运行; +倒序评价,优先比较老的订单; ![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 e276c9b..3005f5e 100644 --- a/jd_comment.py +++ b/jd_comment.py @@ -117,7 +117,7 @@ def generation(pname, _class=0, _type=1, opts=None): spider = jdspider.JDSpider(item,ck) opts['logger'].debug('Successfully created a JDSpider instance') # 增加对增值服务的评价鉴别 - if "赠品" in pname or "非实物" in pname or "权益" in pname or "非卖品" in pname or "增值服务" in pname: + if "赠品" in pname or "非实物" in pname or "京服无忧" in pname or "权益" in pname or "非卖品" in pname or "增值服务" in pname: result = [ "赠品挺好的。", "很贴心,能有这样免费赠送的赠品!", @@ -245,7 +245,7 @@ def sunbw(N, opts=None): opts['logger'].info(f"当前共有{N['待评价订单']}个评价。") opts['logger'].debug('Commenting on items') - for i, Order in enumerate(Order_data): + for i, Order in enumerate(reversed(Order_data)): if i + 1 > 10: opts['logger'].info(f'\t已评价10个订单,跳出') break @@ -393,7 +393,7 @@ def review(N, opts=None): # Order_data.extend(elems) opts['logger'].info(f"当前共有{N['待追评']}个需要追评。") opts['logger'].debug('Commenting on items') - for i, Order in enumerate(Order_data): + for i, Order in enumerate(reversed(Order_data)): if i + 1 > 10: opts['logger'].info(f'\t已评价10个订单,跳出') break @@ -480,7 +480,7 @@ def Service_rating(N, opts=None): # Order_data.extend(elems) opts['logger'].info(f"当前共有{N['服务评价']}个需要服务评价。") opts['logger'].debug('Commenting on items') - for i, Order in enumerate(Order_data): + for i, Order in enumerate(reversed(Order_data)): if i + 1 > 10: opts['logger'].info(f'\t已评价10个订单,跳出') break