# collector **Repository Path**: slayer.hover/collector ## Basic Information - **Project Name**: collector - **Description**: 基于swoole4.0, queryList, redis/mysql连接池实现的协程队列采集器 - **Primary Language**: PHP - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2019-09-06 - **Last Updated**: 2020-12-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # PHP分布式爬虫,基于swoole4.0与QueryList **执行方式:CLI** - 启动: #php ./index.php start - 停止: #php ./index.php stop **运行环境** ``` php >= 7.0 配置swoole4.0扩展与redis扩展 ``` **执行顺序** ``` 1. 执行php queue.php,安排任务队列。 2. swoole启动分布式任务,每五分钟会执行一次。 3. QueryList采集queue队列,将整理好的数据存入Redis ``` **爬虫说明** ``` 1. 执行失败的任务会进入error队列 2. 有任务失败,会自动重新检测代理池,移除失效代理。 3. 依赖库composer.json: { "require": { "jaeger/querylist": "^4.0" } } 4. Pickup::setRule()方法里写页面采集规则。 5. Server::$count定义开启的爬虫数量。 6. 随机代理,随机agent 7. Redis使用到的key定义: queue: 采集任务队列 errorlist:任务失败队列 proxy:代理池 ```