GithubHelp home page GithubHelp logo

chuxiaokai / weibospider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tslmy/weibospider

2.0 1.0 0.0 8.48 MB

Sina Weibo Scraper by Yong HU and Mingyang LI. 2,000 posts per second.

Python 100.00%

weibospider's Introduction

WeiboSpider

Screen Shot

This is a sina weibo spider built by nghuyong largely tailored to run on WWBP's servers by Mingyang Li.

A detailed explanation, written by nghuyong, can be found at 微博爬虫总结:构建单机千万级别的微博爬虫系统.

Description of data structure can be found at 数据字段说明与示例.

Other Branches

The original repo by nghuyong has 3 branches:

Branch Structure Posts per Day
simple single account 100,000
master account pool 1,000,000
senior distributed pool 10,000,000

Usage

  1. Clone thre repo. Install dependencies.
    git clone [email protected]:nghuyong/WeiboSpider.git
    cd WeiboSpider
    pip install -r requirements.txt
  2. Install phantomjs, mongodb, and redis. Start the latter two.
  3. Write down the usernames and passwords of some Sina Weibo accounts in sina/account_build/account.txt. Follow the format indicated in account_sample.txt.
  4. Populate the account pool by running python sina/account_build/login.py.
  5. Populate URLs to start scraping with by issuing python sina/redis_init.py.
  6. Run scraper by running scrapy crawl weibo_spider.

Data Storage

Posts, user profiles, and user relationships (and comments optionally) are stored in the MongoDB.

Performance

With the default setting, 16GB memory, 8-core CPU, Ubuntu, and 36 processes, we are hitting an average of 2,000 posts per second.

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.