a taobao web crawler just for fun.
淘宝文胸商品评论内容爬取与简单分析。
链接: https://pan.baidu.com/s/1bpbuZLX 密码: kvyp
mongoimport -d taobao -c rates --file ./rates.dat
测试环境:腾讯云主机一台
操作系统:ubuntu-14.04
数据库: mongodb
pip install -r requirements.txt
config = {
'timeout' : 3,
'db_user': '',
'db_pass': '',
'db_host': 'localhost',
'db_port': 27017,
'db_name': 'taobao',
'use_tor_proxy': False,
'tor_proxy_port': 9050
}
一般的爬取速度不会有禁IP的情况。如果有被禁IP的情况可以使用tor代理,将config['use_tor_proxy']设置为True,具体方法见python中使用tor代理
python crawler/item_crawler.py # 爬文胸的商品信息
python crawler/rate_crawler.py # 爬文胸的评论信息
cd simple_analyzer
python simple_analyzer.py # 简单统计
cp bra.json data_visualization/static/ # 拷贝统计结果
cd data_visualization
npm install # 安装依赖
npm run dev # 进行调试
npm run build # 生成dist
见: http://nladuo.github.io/bra
cd keyword_analyzer
python create_corpus.py # 1.加载评论信息
python extract_tags.py # 2.提取关键词(20分钟左右, 可以直接用我的模型进行第三步)
python create_wordcloud.py # 3.生成词云图片
MIT