PHPackages                             nelexa/roach-php-bundle - 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. nelexa/roach-php-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

nelexa/roach-php-bundle
=======================

Symfony bundle for roach-php/core

1.1.1(3y ago)101.3k3MITPHPPHP &gt;= 8.0

Since Feb 21Pushed 3y ago3 watchersCompare

[ Source](https://github.com/Ne-Lexa/roach-php-bundle)[ Packagist](https://packagist.org/packages/nelexa/roach-php-bundle)[ RSS](/packages/nelexa-roach-php-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (14)Versions (6)Used By (0)

[![roach-php-bundle](logo.svg)](logo.svg)

roach-php-bundle
================

[](#roach-php-bundle)

Symfony bundle for [Roach PHP](https://roach-php.dev).

[![Latest Stable Version](https://camo.githubusercontent.com/ddfe1649b783c9cc5f3564dc7b3cab705ee15582c99638dd51fe5ef4e0470c05/68747470733a2f2f706f7365722e707567782e6f72672f6e656c6578612f726f6163682d7068702d62756e646c652f76)](https://packagist.org/packages/nelexa/roach-php-bundle) [![PHP Version Require](https://camo.githubusercontent.com/f81247552482489616fbc1625ec875b111d3e1f8a99ae78e32e21680e75f8e6d/68747470733a2f2f706f7365722e707567782e6f72672f6e656c6578612f726f6163682d7068702d62756e646c652f726571756972652f706870)](https://packagist.org/packages/nelexa/roach-php-bundle)[![Tests](https://github.com/Ne-Lexa/roach-php-bundle/actions/workflows/build.yml/badge.svg)](https://github.com/Ne-Lexa/roach-php-bundle/actions/workflows/build.yml)[![Build Status](https://camo.githubusercontent.com/d195d0ad00f832cf5c888ad119b2b1ddc2696d0c2299653660eec521818f4e39/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4e652d4c6578612f726f6163682d7068702d62756e646c652f6261646765732f6275696c642e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/Ne-Lexa/roach-php-bundle/build-status/main)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/498bbcd731f4accd6dd319d46a5fa460aece83389c8cd4e3fce7f6ae9edb6e4f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4e652d4c6578612f726f6163682d7068702d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/Ne-Lexa/roach-php-bundle/?branch=main)[![Code Coverage](https://camo.githubusercontent.com/c4887db0137eaf207151b6b2584d31222c77804419e15274667786b744285cc7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4e652d4c6578612f726f6163682d7068702d62756e646c652f6261646765732f636f7665726167652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/Ne-Lexa/roach-php-bundle/?branch=main)[![License](https://camo.githubusercontent.com/4ac36e576f8eed732a2b8a39fefd79fb6e218c3cffc172a3bbf4ce0751a6d2a9/68747470733a2f2f706f7365722e707567782e6f72672f6e656c6578612f726f6163682d7068702d62756e646c652f6c6963656e7365)](https://packagist.org/packages/nelexa/roach-php-bundle)

> Roach is a complete web scraping toolkit for PHP. It is a shameless clone heavily inspired by the popular Scrapy package for Python.

The Symfony bundle mostly provides the necessary container bindings for the various services Roach uses, as well as making certain configuration options available via a config file. To learn about how to actually start using Roach itself, check out the [rest of the documentation](https://roach-php.dev/docs/spiders).

Installing the Symfony bundle
-----------------------------

[](#installing-the-symfony-bundle)

Add `nelexa/roach-php-bundle` to your composer.json file:

```
composer require nelexa/roach-php-bundle
```

Versions &amp; Dependencies
---------------------------

[](#versions--dependencies)

Bundle versionroach-php/core versionSymfony versionPHP version(s)0.3.00.3.0^5.3 | ^6.0&gt;= 8.01.0.0^1.0.0^6.0&gt;= 8.01.1.01.1.\*^6.0&gt;= 8.0#### Register the bundle:

[](#register-the-bundle)

Register bundle into config/bundles.php (Flex did it automatically):

```
return [
    //...
    \Nelexa\RoachPhpBundle\RoachPhpBundle::class => ['all' => true],
];
```

Available Commands
------------------

[](#available-commands)

The Symfony bundle of Roach registers a few console commands to make out development experience as pleasant as possible.

### Run spider

[](#run-spider)

```
php bin/console roach:run
```

After that, you will get the entire list of available spiders.

```

 Choose a spider class:
  [0] App\Spider\GoogleSpider
  [1] App\Spider\FacebookSpider
  [2] App\Spider\TwitterSpider

```

Simply select the desired spider (▼ or ▲) or enter its number and press Enter.

You can pass as the first argument the name spider class name to run or its alias. For example, if you have a class `App\Spider\GoogleSpider`, then you can pass the following aliases: `GoogleSpider`, `google_spider` or `google`.

```
php bin/console roach:run google
```

Sometimes it is useful to override the number of concurrent requests and the pre-request delay. To do this, you can pass the `--concurrency` and `--delay` options.

```
php bin/console roach:php google --concurrency 8 --delay 2
```

These options override the `$concurrency` and `$requestDelay` public properties of your spider.

Add the `--output` (`-o`) option and you can save the collected data to a JSON file.

```
php bin/console roach:php google --output 'path/to/data.json'
```

### Starting the REPL

[](#starting-the-repl)

Roach ships with an [interactive shell](https://roach-php.dev/docs/repl) (often called Read-Evaluate-Print-Loop, or Repl for short) which makes prototyping our spiders a breeze. We can use the provided `roach:shell` command to launch a new Repl session.

```
php bin/console roach:shell "https://roach-php.dev/docs/introduction"
```

### Generator classes

[](#generator-classes)

First install [`Symfony MakerBundle`](https://symfony.com/bundles/SymfonyMakerBundle/current/index.html).

```
composer require --dev symfony/maker-bundle
```

#### Create a new roach spider class

[](#create-a-new-roach-spider-class)

```
php bin/console make:roach:spider
```

#### Create a new roach extension class

[](#create-a-new-roach-extension-class)

```
php bin/console make:roach:extension
```

#### Create a new roach item processor class

[](#create-a-new-roach-item-processor-class)

```
php bin/console make:roach:item:processor
```

#### Create a new roach downloader request middleware class

[](#create-a-new-roach-downloader-request-middleware-class)

```
php bin/console make:roach:middleware:downloader:request
```

#### Create a new roach downloader response middleware class

[](#create-a-new-roach-downloader-response-middleware-class)

```
php bin/console make:roach:middleware:downloader:response
```

#### Create a new roach spider item middleware class

[](#create-a-new-roach-spider-item-middleware-class)

```
php bin/console make:roach:middleware:spider:item
```

#### Create a new roach spider request middleware class

[](#create-a-new-roach-spider-request-middleware-class)

```
php bin/console make:roach:middleware:spider:request
```

#### Create a new roach spider response middleware class

[](#create-a-new-roach-spider-response-middleware-class)

```
php bin/console make:roach:middleware:spider:response
```

Screencast
----------

[](#screencast)

[![asciicast](https://camo.githubusercontent.com/2f7d4c5c7861bde6d3327faa2b8831718a43ff8b90e0e4b0382daf41c28aa5f7/68747470733a2f2f61736369696e656d612e6f72672f612f6e6147727036307a794e5651616b517856307630566e7776632e737667)](https://asciinema.org/a/naGrp60zyNVQakQxV0v0Vnwvc)

Credits
-------

[](#credits)

- [Ne-Lexa](https://github.com/Ne-Lexa)
- [All contributors](https://github.com/Ne-Lexa/roach-php-bundle/graphs/contributors)

Changelog
---------

[](#changelog)

Changes are documented in the [releases page](https://github.com/Ne-Lexa/roach-php-bundle/releases).

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.7% 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 ~74 days

Total

4

Last Release

1323d ago

Major Versions

0.3.0 → 1.0.02022-04-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/58ee2cf9c1aa935ef472b891a770bb2ce298a231af130f375cfcaa76d2a9a891?d=identicon)[Ne-Lexa](/maintainers/Ne-Lexa)

---

Top Contributors

[![Ne-Lexa](https://avatars.githubusercontent.com/u/17830391?v=4)](https://github.com/Ne-Lexa "Ne-Lexa (22 commits)")[![Azmandios](https://avatars.githubusercontent.com/u/23055853?v=4)](https://github.com/Azmandios "Azmandios (1 commits)")

---

Tags

crawlerphproach-phpscrapyspidersymfonysymfony-bundle

###  Code Quality

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nelexa-roach-php-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/nelexa-roach-php-bundle/health.svg)](https://phpackages.com/packages/nelexa-roach-php-bundle)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

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