Code Monkey home page Code Monkey logo

zhihu-spider's Introduction

zhihu-spider

A web spider for zhihu.com, which is used for ZhihuHot.
This spider can scrape question & topic data from zhihu.com.

Author

I'm Morgan Zhang, a graduate computer science student in University of San Francisco.

My another tool

See my another command line tool line here, which can tell you the amount of lines and files under current directory.

Why I made zhihu-spider

Coding for fun as well as learn Python.

Contact Information

[email protected]

Run it

What do you need to run it

  • Python 2.7.6 (Maybe it work for other versions.)
  • MySQL
  • BeautifulSoup

How to run it

  1. Download the code
  2. Run init.sql to set up datebase and insert initial data.
  3. Find out your cookie of zhihu.com throught browser's developer tool.
  4. Modify config.ini
  5. Use python question.py to scrpy questions from zhihu.com
  6. Use python topic.py to scrpy topics from zhihu.com

Warning

You can change thread amount in config.ini to make this spider run faster.
But your IP may be blocked from zhihu.com if you connect to zhihu.com too frequently.
You'd better use proxy when you use multi thread mode.

License

The MIT license.

zhihu-spider's People

Contributors

morganzhang100 avatar

Watchers

Shiyue Mao 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.