File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1414
1515## 使用方法
1616
17+ ### <请先确保python版本为最新版>
18+
1719在终端中执行:
1820
1921``` bash
Original file line number Diff line number Diff line change 3232}
3333# 评价生成
3434def generation (pname , _class = 0 , _type = 1 ):
35- list = ['商品名' ]
36- list .clear ()
37- list .append (pname )
38- for item in list :
35+ items = ['商品名' ]
36+ items .clear ()
37+ items .append (pname )
38+ for item in items :
3939 spider = jdspider .JDSpider (item )
4040 #增加对增值服务的评价鉴别
4141 if "赠品" in pname or "非实物" in pname or "增值服务" in pname :
4242 result = ["赠品挺好的。" ,
43- "很贴心,能有这样免费赠送的赠品" ,
43+ "很贴心,能有这样免费赠送的赠品! " ,
4444 "正好想着要不要多买一份增值服务,没想到还有这样的赠品。" ,
4545 "赠品正合我意。" ,
4646 "赠品很好,挺不错的。"
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ def solvedata(self, remarks):
178178
179179# 测试用例
180180if __name__ == "__main__" :
181- list = ['商品名' ]
182- for item in list :
181+ jdlist = ['商品名' ]
182+ for item in jdlist :
183183 spider = JDSpider (item )
184184 spider .getData (2 , 3 )
You can’t perform that action at this time.
0 commit comments