PHPackages                             styeer/phpspider - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. styeer/phpspider

ActiveLibrary[Framework](/categories/framework)

styeer/phpspider
================

The PHPSpider Framework.

v1.0.3(1y ago)05MITPHPPHP &gt;=5.5.0

Since Jul 1Pushed 1y agoCompare

[ Source](https://github.com/styeer/phpspider)[ Packagist](https://packagist.org/packages/styeer/phpspider)[ Docs](http://www.phpspider.org)[ RSS](/packages/styeer-phpspider/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

phpspider -- PHP蜘蛛爬虫框架
======================

[](#phpspider----php蜘蛛爬虫框架)

《我用爬虫一天时间“偷了”知乎一百万用户，只为证明PHP是世界上最好的语言 》所使用的程序

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

demo目录下有一些特定网站的爬取规则，只要你安装了PHP环境，代码就可以在命令行下直接跑。 对爬虫感兴趣的开发者可以加QQ群一起讨论：147824717。

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

```
$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();`来配置并启动爬虫.

#### 运行界面如下:

[](#运行界面如下)

[![](https://camo.githubusercontent.com/34489ee7a4e8a6b46e79cc41351e9a2de2a944e7cc2143e92f685752ed73cf28/687474703a2f2f7777772e65706f6f6c6c2e636f6d2f7a686968752f706163686f6e672e676966)](https://camo.githubusercontent.com/34489ee7a4e8a6b46e79cc41351e9a2de2a944e7cc2143e92f685752ed73cf28/687474703a2f2f7777772e65706f6f6c6c2e636f6d2f7a686968752f706163686f6e672e676966)

更多详细内容，移步到：

[开发文档](http://doc.phpspider.org)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1182 days

Total

2

Last Release

598d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7025836d8dfc3ff97e65d33b8406ad87e4a5cf1117752f1e9820de2a76148b8?d=identicon)[Styeer](/maintainers/Styeer)

---

Top Contributors

[![owner888](https://avatars.githubusercontent.com/u/4317332?v=4)](https://github.com/owner888 "owner888 (240 commits)")[![suppernice](https://avatars.githubusercontent.com/u/188820197?v=4)](https://github.com/suppernice "suppernice (7 commits)")[![styeer](https://avatars.githubusercontent.com/u/9474211?v=4)](https://github.com/styeer "styeer (5 commits)")[![awebc](https://avatars.githubusercontent.com/u/9549821?v=4)](https://github.com/awebc "awebc (1 commits)")[![kayw-geek](https://avatars.githubusercontent.com/u/29700073?v=4)](https://github.com/kayw-geek "kayw-geek (1 commits)")

---

Tags

frameworkphpspider

### Embed Badge

![Health badge](/badges/styeer-phpspider/health.svg)

```
[![Health](https://phpackages.com/badges/styeer-phpspider/health.svg)](https://phpackages.com/packages/styeer-phpspider)
```

###  Alternatives

[owner888/phpspider

The PHPSpider Framework.

3.5k20.8k2](/packages/owner888-phpspider)[hemp/presenter

Easy Model Presenters in Laravel

247592.6k1](/packages/hemp-presenter)[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)[wpstarter/framework

The WpStarter Framework - Laravel Framework for WordPress

1810.1k4](/packages/wpstarter-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
