2017 © Pedro Peláez
 

library php-spider

The PHPSpider Framework.

image

cyd622/php-spider

The PHPSpider Framework.

  • Wednesday, April 4, 2018
  • by tonywang
  • Repository
  • 0 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 977 Forks
  • 0 Open issues
  • 15 Versions
  • 50 % Grown

The README.md

phpspider -- PHP蜘蛛爬虫框架

phpspider是一个爬虫开发框架。使用本框架,你不用了解爬虫的底层技术实现,爬虫被网站屏蔽、有些网站需要登录或验证码识别才能爬取等问题。简单几行PHP代码,就可以创建自己的爬虫,利用框架封装的多进程Worker类库,代码更简洁,执行效率更高速度更快。, (*1)

demo目录下有一些特定网站的爬取规则,只要你安装了PHP环境,代码就可以在命令行下直接跑., (*2)

下面以糗事百科为例, 来看一下我们的爬虫长什么样子:, (*3)

$configs = array(
    'name' => '糗事百科',
    'domains' => array(
        'qiushibaike.com',
        'www.qiushibaike.com'
    ),
    'scan_urls' => array(
        'http://www.qiushibaike.com/'
    ),
    'content_url_regexes' => array(
        "http://www.qiushibaike.com/article/\d+"
    ),
    'list_url_regexes' => array(
        "http://www.qiushibaike.com/8hr/page/\d+\?s=\d+"
    ),
    'fields' => array(
        array(
            // 抽取内容页的文章内容
            'name' => "article_content",
            'selector' => "//*[@id='single-next-link']",
            'required' => true
        ),
        array(
            // 抽取内容页的文章作者
            'name' => "article_author",
            'selector' => "//div[contains(@class,'author')]//h2",
            'required' => true
        ),
    ),
);
$spider = new phpspider($configs);
$spider->start();

爬虫的整体框架就是这样, 首先定义了一个$configs数组, 里面设置了待爬网站的一些信息, 然后通过调用$spider = new phpspider($configs);$spider->start();来配置并启动爬虫., (*4)

运行界面如下:

, (*5)

更多详细内容,移步到:, (*6)

开发文档, (*7)

The Versions

04/04 2018

dev-master

9999999-dev https://xiluhuo.cn/

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

04/04 2018

v2.1.4

2.1.4.0 https://xiluhuo.cn/

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

02/12 2017

dev-test

dev-test http://www.phpspider.org

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

04/11 2017

v2.1.3

2.1.3.0 http://www.phpspider.org

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

18/10 2017

v2.1.2

2.1.2.0 http://www.phpspider.org

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

16/10 2017

v2.1.1

2.1.1.0 http://www.phpspider.org

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

16/10 2017

v2.1.0

2.1.0.0 http://www.phpspider.org

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

14/09 2017

v2.0.8

2.0.8.0 http://www.phpspider.org

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

12/08 2017

v2.0.7

2.0.7.0 http://www.phpspider.org

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

08/08 2017

v2.0.6

2.0.6.0 http://www.phpspider.org

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

08/08 2017

v2.0.5

2.0.5.0 http://www.phpspider.org

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

08/08 2017

v2.0.4

2.0.4.0 http://www.phpspider.org

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

07/08 2017

v2.0.3

2.0.3.0 http://www.phpspider.org

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

07/08 2017

v2.0.2

2.0.2.0 http://www.phpspider.org

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider

07/08 2017

v2.0.1

2.0.1.0 http://www.phpspider.org

The PHPSpider Framework.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework phpspider