Code Monkey home page Code Monkey logo

php-selenium-example's Introduction

PHP爬虫:Selenium + 代理池

介绍

  • 主要解决防爬机制比较强的网站
  • 仅用于交流和学习,禁止利用本资源从事任何违反本国(地区)法律法规的活动,一切遵守《网络安全法》

教程

运行环境

  • CentOS 7.2
  • PHP7.2
  • Swoole 4.3.5
  • EasySwoole 3.1.18
  • Google Chrome 78.0.3904.108
  • ChromeDriver 78.0.3904.105

核心包

  • facebook/webdriver

主要模块

  • 定时更新代理池(自定义进程)
  • 定时爬取列表(自定义进程)
  • 主进程查询列表项,将每一项丢给异步任务,异步任务使用谷歌浏览器+代理爬取对应数据

运行

#后台启动 Selenium Server
nohup  java -jar selenium-server-standalone-3.141.59.jar  &

#拉取项目代码
git clone https://github.com/ar414-com/phpseleniumdemo.git && cd ./phpseleniumdemo 

#安装依赖
composer install

#安装框架
php ./vendor/easyswoole/easyswoole/bin/easyswoole install 
#EasySwooleEvent.php has already existed, do you want to replace it? [ Y/ N (default) ] : N 
#dev.php has already existed, do you want to replace it? [ Y / N (default) ] : N
#produce.php has already existed, do you want to replace it? [ Y / N (default) ] : N

#修改App\Process\UpdateProxyPool,改成爬取你代理的逻辑,这里使用的是站大爷代理 提取链接马赛克了

#运行
php easyswoole start

php-selenium-example's People

Contributors

ar414-com avatar coderbrother8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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