Skip to content

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gootworms

Status GitHub Issues GitHub Pull Requests License


Few lines describing your project.

📝 Table of Contents

🧐 About

这是一个用golang编写的主从分布式爬虫

🏁 Getting Started

Project Tree

Gootworms
├─ conf
│  └─ config.yml //爬虫规则及数据库的配置文件
├─ Dockerfile   
├─ go.mod
├─ go.sum
├─ LICENSE
├─ main
├─ main.go
├─ README.md
├─ src
│  ├─ Data
│  │  ├─ Enum  //存放常量信息
│  │  │  └─ NodeConstants
│  │  │     └─ NodeConstants.go 
│  │  ├─ Job.go
│  │  └─ Result.go
│  ├─ Master
│  │  ├─ Master.go
│  │  └─ Master_test.go
│  ├─ Slave
│  │  ├─ Downloader
│  │  │  ├─ Downloader.go
│  │  │  └─ Downloader_test.go
│  │  ├─ Node
│  │  │  └─ NodeManager.go
│  │  └─ Spider
│  │     ├─ Spider.go
│  │     └─ Spider_test.go
│  └─ Utils  //工具类
│     ├─ ChromeDriverUtil
│     │  ├─ ChromeDriverUtil.go
│     │  └─ ChromeDriverUtil_test.go
│     ├─ ConfigUtil
│     │  ├─ ConfigUtil.go
│     │  └─ ConfigUtil_test.go
│     ├─ CronUtil
│     │  ├─ CronUtil.go
│     │  └─ CronUtilTest.go
│     ├─ DBUtils
│     │  ├─ MongoUtil
│     │  │  ├─ config.yml
│     │  │  ├─ MongoUtil.go
│     │  │  └─ MongoUtil_test.go
│     │  └─ RedisUtil
│     │     ├─ RedisUtil.go
│     │     └─ RedisUtil_test.go
│     ├─ HttpUtil  //Http解析
│     │  └─ DoRequest
│     │     ├─ DoRequest.go
│     │     └─ DoRequest_test.go
│     ├─ LinksUtil  //提取文本中的链接
│     │  ├─ config.yml
│     │  ├─ LinksUtil.go
│     │  └─ LinksUtil_test.go
│     └─ TaskUtil
│        ├─ TaskUtil.go
│        └─ TaskUtil_test.go
└─ TODO.md

Prerequisites

启动分为从节点(worker)和主节点(master)两种模式。开启redis-server和mongodb服务,且先启动主节点(需安装并启动redis和mongodb),再启动从节点

主节点启动

go run main master

从节点启动

go run main worker

⛏️ Built Using

  • MongoDB-4.4.1 -存储数据库
  • Redis-6.2.1 - 节点RPC通信依赖
  • golang-1.5 - 开发语言

✍️ Authors

🎉 Acknowledgements

  • Hat tip to anyone whose code was used
  • Inspiration
  • References

About

This is a distribute crawler wrote by golang.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages