Giter Club home page Giter Club logo

taobao_bra_crawler's Introduction

taobao_bra_crawler

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      # 爬文胸的评论信息

数据处理

简单统计与可视化展示

1. 运行脚本

cd simple_analyzer
python simple_analyzer.py               # 简单统计
cp bra.json data_visualization/static/  # 拷贝统计结果

2. 运行网页显示

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.生成词云图片

效果

word_cloud

参考

LICENSE

MIT

taobao_bra_crawler's People

Contributors

nladuo avatar shirlay-chang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.