PHPackages                             johnroyer/crawler-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. johnroyer/crawler-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

johnroyer/crawler-php
=====================

crawler implement in PHP

0.3.6(2y ago)365[3 issues](https://github.com/johnroyer/crawler-php/issues)MITPHPPHP ^8.1|^8.2

Since Sep 13Pushed 2y ago1 watchersCompare

[ Source](https://github.com/johnroyer/crawler-php)[ Packagist](https://packagist.org/packages/johnroyer/crawler-php)[ RSS](/packages/johnroyer-crawler-php/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (16)Used By (0)

Introduction
------------

[](#introduction)

Web crawler in simple.

**Note**: this is a site project. Do NOT use in production.

Usage
-----

[](#usage)

Create handler from `AbstractHandler`, and set domain which handler should handles:

```
class MyHandler extends \Zeroplex\Crawler\Handler\AbstractHandler
{
    public function getDomain(): string
    {
        return 'test.com';
    }

    public function shouldFetch(\Psr\Http\Message\RequestInterface $request): bool
    {
        if (1 === preg_match('/(css|js|jpg|png|gif)$/', $request->getUri())) {
            // ignore css, js and common images
            return false;
        }
        return true;
    }

    public function handle(\Psr\Http\Message\ResponseInterface $response): void
    {
        // get content using $response->getBody()->getContents()
    }
}
```

Then setup crawler and run:

```
$crawler = new \Zeroplex\Crawler\Crawler();

$crawler->setDelay(0)
    ->setTimeout(3)
    ->setFollowRedirect(true)
    ->setUserAgent('Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/100.1');

$crawler->addHandler(new BlogHandler());

// URL to start
$crawler->run('https://test.com');
```

Extends
-------

[](#extends)

For example, implement URL queue by Predis.

composer install:

```
composer require predis/predis
```

Implement `UrlQueueInterface`:

```
class RedisQueue implements Zeroplex\Crawler\UrlQueue\UrlQueueInterface
{
    private $redis;
    public function __construct(string $host, int $port) { }

    public function push(string $url): void
    {
        $this->redis->lpush($url);
    }

    public function pop(): string
    {
        return $this->redis->lpop();
    }

    // and so on
}
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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 ~42 days

Recently: every ~77 days

Total

13

Last Release

875d ago

PHP version history (3 changes)0.0.1PHP ^7.4|^8.0

0.0.2PHP ^8.0|^8.1|^8.2

0.3.0PHP ^8.1|^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/114491?v=4)[Zero Huang](/maintainers/johnroyer)[@johnroyer](https://github.com/johnroyer)

---

Top Contributors

[![johnroyer](https://avatars.githubusercontent.com/u/114491?v=4)](https://github.com/johnroyer "johnroyer (366 commits)")

---

Tags

crawlerphp

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/johnroyer-crawler-php/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[spatie/crawler

Crawl all internal links found on a website

2.8k18.5M65](/packages/spatie-crawler)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M341](/packages/drupal-core-dev)[blackfire/player

A powerful web crawler and web scraper with Blackfire support

49517.1k](/packages/blackfire-player)[crwlr/crawler

Web crawling and scraping library.

36917.4k2](/packages/crwlr-crawler)

PHPackages © 2026

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