Giter VIP home page Giter VIP logo

crawler's Introduction

一个学习的爬虫项目

简介

这是一个出于学习目的的爬虫实战项目,目的是提升自身的编程水平。

知识点

  • git
  • circleCI
  • PR
  • test
  • SpotBugs
  • flywaydb
  • mybatis

思路

需求分析

用法

    CrawlerDAO dao = new MyBatisCrawlerDAO();
    for (int i = 0; i < 6; i++) {
        new Thread(new Crawler(dao)).start();
    }

使用数据库存储数据,项目中建 db.config.json 文件。文件格式如下:

{
  "jdbc": "xxx",
  "user": "xxx",
  "password": "xxx"
}

功能点

  • 可以断点续爬。
  • 自动创建数据表和初始化数据

数据库

表设计

文件 src/main/resources/db/migration/V1__Create_table.sql 里已创建相关表

初始数据

文件 src/main/resources/db/migration/V1_1__Initial_Setup.sql 插入初始化数据 执行 mvn flyway:migrate 会自动创建表和数据

MyBatis

文件 src/main/resources/db/mybatis/config.xml 配置数据库和映射文件 文件 src/main/resources/db/mybatis/MyMapper.xml 放入相关数据库操作

参考文章

crawler's People

Contributors

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