Git Product home page Git Product logo

zhihu's Introduction

简介

一个简单的抓取知乎所有问题的小爬虫,通过该爬虫可建立知乎的问题种子库,便于抓取热 门问题和回答,或满足其它的需求.

使用说明

1、修改 settings.yaml 中的 ‘EMAIL’ 和 'PASSWORD' 字段.
2、执行

$ python3 zhihuspider.py

即可.

注意

1、默认只抓取如下几个字段:

  • 问题名
  • 问题的 url
  • 提问者名字
  • 提问者的主页 url
  • 提问时间

2、默认采用单线程抓取,抓取速度很慢。其实通过这个小爬虫就可以看出请求的规则,有 兴趣可以尝试多进程/多线程或用 Gevent 进行并行抓取,很简单,但要注意控制好抓取频 率,防止因为给知乎服务器带来太大压力而被封.(慎重考虑)

其它说明

有兴趣可以看下我的 这篇博 客,其中总结了写这个 爬虫过程中的一些最佳实践.

zhihu's People

Watchers

James Cloos avatar  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.