Coder Social home page Coder Social logo

pickupadvance's Introduction

PHP爬虫,基于swoole与QueryList

执行方式:CLI

  • 启动: #php start.php
  • 停止: #php stop.php

运行环境

php >= 7.0 配置swoole扩展与redis扩展

执行顺序

1. 执行php tastqueue.php,安排任务队列queue。
2. swoole启动分布式任务,自定义启动进程数。
3. QueryList采集queue队列,将整理好的数据入库

爬虫说明

1. 执行失败的任务会进入errorlist队列
2. 有任务失败,会自动重新检测代理池,移除失效代理。
3. 依赖库composer.json:
{
    "require": {
        "jaeger/querylist": "^4.0",
		"illuminate/database":"~4.2"
    }
}
4. Pickup::setRule()方法里写页面采集规则。
5. Server::$count定义开启的爬虫数量。
6. 随机代理,随机agent
7. Redis使用到的key定义:
	queue: 采集任务队列
	errorlist:任务失败队列
	proxy:代理池

pickupadvance's People

Contributors

slayerhover avatar

Watchers

 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.