Git Product home page Git Product logo

nugget's Introduction

掘金文章爬虫

一、项目介绍

爬取掘金后端的所有分类以及每个分类下面的所有热门文章。

二、使用说明

1、此项目基于python3.7.3,使用前请确保系统安装了python3.7.3。

2、项目中使用redis作为队列,使用前确保系统安装了redis

2、使用命令 pip3 install -r requirement.txt 安装依赖包。

3、在项目根目录下创建conf文件夹,文件夹中创建spider.conf,并填入以下内容:

[main]                                  # 主要配置,名称不可变
env=local                               # 当前环境,根据此值读取不同配置

[mysql_local]                           # 开发环境的mysql配置
host=host                               # host:数据库地址
port=port                               # port:数据库端口
user=username                           # username:用户名
pass=password                           # password:密码
db=db_name                              # db_name:数据库名称

[redis]                                 # redis配置
host=host                               # host:redis地址
port=port                               # port:redis端口

4、运行

执行以下命令,运行项目:

 python3 spider/main.py                 # 爬取文章
 python3 spider/post.py                 # 爬取文章内容

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.