PHPackages                             luojixinhao/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. luojixinhao/phpspider

ActiveLibrary

luojixinhao/phpspider
=====================

copy from owner888/phpspider

1.0.1(8y ago)122MITPHP

Since Jun 23Pushed 8y ago2 watchersCompare

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

READMEChangelog (2)DependenciesVersions (2)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

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 99.1% 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

Unknown

Total

1

Last Release

3243d ago

### Community

Maintainers

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

---

Top Contributors

[![owner888](https://avatars.githubusercontent.com/u/4317332?v=4)](https://github.com/owner888 "owner888 (232 commits)")[![luojixinhao](https://avatars.githubusercontent.com/u/8543527?v=4)](https://github.com/luojixinhao "luojixinhao (2 commits)")

### Embed Badge

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

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

PHPackages © 2026

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