Code Monkey home page Code Monkey logo

weibospider's Introduction

WeiboSpider

WeiboSpider written in Python to get all original texts and images of an account

running instructions

step0: follow the comments in WeiboSpider.py carefully to get cookies and user_id and paste them into the code or to change page_start and page_end (optional)

step1: pick a folder to store all the text files and weibo_image folder

step2: cd to the directory picked

step3: open terminal: python ..../WeiboSpider.py (just drag it into terminal) (some libs may need to be installed with pip)

every oripic url and picall url will be printed in terminal

all img urls failed to download will be recorded in a new txt file

END

id.txt and id_raw.txt are the same file with different names for further changes on id.txt may be needed to do data analysis

inspired by dingmyu/weibo_analysis

  1. invalid RegExps are updated

  2. libs written in python(beautifulsoup etc.) are replaced by those written in C++(re, lxml etc.) to increase efficiency

  3. a new method is implemented to extract img address accessible without cookies directly from oripic url to increase efficiency

  4. the first img url in picAll page is skipped since it was already extracted in previous page

further developments

  1. implement the code to analyze url with filter=0 (all weiboes)

  2. optimize data analysis process

  3. make it into a lib. users only need to call a function with several parameters to do all above

weibospider's People

Contributors

g20150120 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.