PHPackages                             monkeyphp/php-spider - 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. monkeyphp/php-spider

ActiveLibrary

monkeyphp/php-spider
====================

A basic web spider written in PHP.

0.0.2(9y ago)2761[1 issues](https://github.com/monkeyphp/php-spider/issues)BSD-3-ClausePHPPHP &gt;=5.3.3

Since Sep 10Pushed 7y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

PhpSpider
=========

[](#phpspider)

[![Latest Stable Version](https://camo.githubusercontent.com/ebdab48e3fe81c9e30f594108543223d27246277707e54a6e427440a8ac60b5b/68747470733a2f2f706f7365722e707567782e6f72672f6d6f6e6b65797068702f7068702d7370696465722f762f737461626c652e706e67)](https://packagist.org/packages/monkeyphp/php-spider)[![Total Downloads](https://camo.githubusercontent.com/8e8d4b99a07aa3c2f53ca3a1665dc6e1d8b8541645e297f0993b0e8c20dc443e/68747470733a2f2f706f7365722e707567782e6f72672f6d6f6e6b65797068702f7068702d7370696465722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/monkeyphp/php-spider)[![Latest Unstable Version](https://camo.githubusercontent.com/9d4f3ae6a511e73f01a1040b56aa453de144899c9338bd3599bc902d6da6ed50/68747470733a2f2f706f7365722e707567782e6f72672f6d6f6e6b65797068702f7068702d7370696465722f762f756e737461626c652e706e67)](https://packagist.org/packages/monkeyphp/php-spider)[![License](https://camo.githubusercontent.com/1f63243697187e4ff8c01d59fd4242765093b0bcc00837c46d01e5b86d9b8fe2/68747470733a2f2f706f7365722e707567782e6f72672f6d6f6e6b65797068702f7068702d7370696465722f6c6963656e73652e706e67)](https://packagist.org/packages/monkeyphp/php-spider)

> I needed a really basic spider to crawl a site to warm the cache; this is the result.

Examples
--------

[](#examples)

### Simple

[](#simple)

The simplest way to use PhpSpider is to construct an instance and pass the root url of the site that you wish to crawl to the `Spider::crawl` method.

By design, PhpSpider will only crawl pages that

- Return a `content-type` header of `text\html`
- That are on the same domain as the supplied root

```
use PhpSpider\Spider\Spider;

$spider = new Spider();
$spider->crawl('https://www.example.com');
```

### Advanced

[](#advanced)

If you need to override how PhpSpider works you can add event listeners to be notified, that can then affect how PhpSpider operates.

There are 5 events triggered by PhpSpider

- **Spider::SPIDER\_CRAWL\_PRE** - Triggered before PhpSpider starts to crawl a site.
- **Spider::SPIDER\_CRAWL\_POST** - Triggered one PhpSpider has finished it's crawl.
- **Spider::SPIDER\_CRAWL\_PAGE\_PRE** - Triggered just before a page is crawled
- **Spider::SPIDER\_CRAWL\_PAGE\_POST** - Triggered once a page is crawled
- **Spider::SPIDER\_CRAWL\_PAGE\_ERROR** - Trigged if an error occurs whilst crawling a page

You can find examples in the examples directory included in this repository.

```
    $ php ./examples/example_0.php
```

```
use PhpSpider\Spider\Spider;
use Zend\EventManager\Event;

$listener function ($event) {
    $uri = $event->getParam('uri');
    echo $uri;
};

$spider = new Spider();
$spider->getEventManager()->attach(Spider::SPIDER_CRAWL_PAGE_PRE, $listener, 1000);

$spider->crawl('https://www.example.com');
```

To Run Tests
------------

[](#to-run-tests)

```
$ vendor/bin/phpunit -c tests/phpunit.xml
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~13 days

Total

2

Last Release

3520d ago

### Community

Maintainers

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

---

Top Contributors

[![monkeyphp](https://avatars.githubusercontent.com/u/1448153?v=4)](https://github.com/monkeyphp "monkeyphp (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/monkeyphp-php-spider/health.svg)

```
[![Health](https://phpackages.com/badges/monkeyphp-php-spider/health.svg)](https://phpackages.com/packages/monkeyphp-php-spider)
```

###  Alternatives

[socalnick/scn-social-auth

Uses the HybridAuth PHP library to Enable authentication via Google, Facebook, Twitter, Yahoo!, etc for the ZfcUser ZF2 module.

21974.2k3](/packages/socalnick-scn-social-auth)[zfr/zfr-cors

Zend Framework module that let you deal with CORS requests

611.2M3](/packages/zfr-zfr-cors)[zucchi/zucchi

Zucchi Component Library for Zend Framework 2

121.5k1](/packages/zucchi-zucchi)

PHPackages © 2026

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