File tree Expand file tree Collapse file tree 4 files changed +23
-3
lines changed
Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 66源库链接:[ 自动评价] ( https://github.com/qiu-lzsnmb/jd_lzsnmb )
77[ 评论爬虫] ( https://github.com/2274900/JD_comment_spider )
88
9- ### 本脚本只是对以上两位的结合以及魔改,用于解决评论文不对题的问题。经测试,本脚本能初步解决这一问题。
9+ ### 本脚本只是对以上两位的结合以及魔改,用于解决评论文不对题的问题。经测试,本脚本能初步解决这一问题。
1010
1111## 思路
1212
1313由爬虫先行对商品的既有评价进行爬取,在此基础上进行自己的评价
1414
1515## 使用方法
1616
17- 获取电脑版ck后填入 auto_comment_plus.py 文件,运行此文件即可
17+ 在终端中执行:
18+
19+ ``` bash
20+ git clone https://github.com/Dimlitter/jd_AutoComment.git
21+ cd jd_AutoComment
22+ pip install -r requirements.txt
23+ ```
24+
25+ 然后获取电脑版ck后填入 auto_comment_plus.py 文件,运行此文件即可
1826
1927> 此脚本需要的依赖较多,需自行安装
2028
Original file line number Diff line number Diff line change 99import requests
1010from lxml import etree
1111import jdspider
12+ import yaml
13+
14+ CONFIG_PATH = './config.yml'
1215
1316jieba .setLogLevel (jieba .logging .INFO )
1417"""
1518ck填到下面就好,只支持网页版的Ck
1619以下为最短格式
1720"""
18- ck = ''
21+ with open (CONFIG_PATH , 'r' , encoding = 'utf-8' ) as f :
22+ cfg = yaml .safe_load (f )
23+ ck = cfg ['user' ]['cookie' ]
1924
2025headers = {
2126 'cookie' : ck ,
Original file line number Diff line number Diff line change 1+ user :
2+ cookie : ' '
Original file line number Diff line number Diff line change 1+ jieba
2+ requests
3+ lxml
4+ zhon
5+ pyyaml
You can’t perform that action at this time.
0 commit comments