PHPackages                             deloz/botium - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. deloz/botium

ActiveLibrary[HTTP &amp; Networking](/categories/http)

deloz/botium
============

A light web crawl written in PHP

0.1.0(10y ago)1211MITPHPPHP &gt;=5.6.0

Since Jul 9Pushed 10y ago2 watchersCompare

[ Source](https://github.com/deloz/botium)[ Packagist](https://packagist.org/packages/deloz/botium)[ RSS](/packages/deloz-botium/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Botium
======

[](#botium)

A light web crawl written in PHP.

Installation
------------

[](#installation)

1. Install composer:

    ```
    curl -sS https://getcomposer.org/installer | php
    ```

    You can add Botium as a dependency using the composer.phar CLI:

    ```
    php composer.phar require deloz/botium:~0.1
    ```
2. Alternatively, you can specify Botium as dependency in your project's existing composer.json file:

    ```
    {
    	"require": {
    	  "deloz/botium": "~0.1"
    	}
    }
    ```
3. After installing, you need to require Composer's autoloader:

    ```
    	require 'vendor/autoload.php';
    ```

Running the tests
-----------------

[](#running-the-tests)

```
cd tests
php runtest.php
```

Usage
-----

[](#usage)

`$settings` must contain `baseUrl`, eg:

```
$settings = [
	'baseUrl' => 'www.douban.com',
	'debug' => true,
	'interval' => 10,
	'every' => 5,
];
```

every site is a Class which inherit from `Deloz\Botium\Botium` with overriding the methods as blow:

```
namespace Tests;

use Symfony\Component\DomCrawler\Crawler;
use Deloz\Botium\Response;
use Deloz\Botium\Botium;

class Haixiu extends Botium
{
	public function start()
	{
		$res = $this->crawl('http://www.douban.com/group/haixiuzu/discussion');
		$res and $this->index($res);
	}

	public function index(Response $res)
	{
		$res->doc('td.title > a')->each(function (Crawler $node, $i) {
			$link = $node->attr('href');
			if ($link) {
				$res = $this->crawl($link);
				$res and $this->detail($res);
			}
		});
	}

	public function detail(Response $res)
	{
		$title = $res->doc('#content > h1')->text();
		$author = $res->doc('#content > div > div.article > div.topic-content.clearfix > div.topic-doc > h3 > span.from > a')->text();
		$images = [];
		$res->doc('div.topic-content > div.topic-figure.cc img')->each(function (Crawler $node, $i) use (&$images, $res) {
			$img = $node->attr('src');
			if ($img) {
				$images[] = $img;
			}
		});

		$this->result([
			'title' => $title,
			'author' => $author,
			'images' => $images,
		]);
	}

	public function result(array $item = [])
	{
		var_dump($item);
	}
}
```

more examples, see directory [tests](https://github.com/deloz/botium/tests)

License
-------

[](#license)

licensed using the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

3988d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/268b5fc0fee2fa459cb5c25d91248588489e0d09600b63c4ecbd23278644a7eb?d=identicon)[deloz](/maintainers/deloz)

---

Tags

httpurisearchspidercrawl

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/deloz-botium/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

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

Crawl all internal links found on a website

2.8k17.7M58](/packages/spatie-crawler)[quickbooks/v3-php-sdk

The Official PHP SDK for QuickBooks Online Accounting API

28110.2M31](/packages/quickbooks-v3-php-sdk)[spatie/laravel-export

Create a static site bundle from a Laravel app

670139.5k6](/packages/spatie-laravel-export)[sproutcms/cms

Enterprise content management and framework

242.2k4](/packages/sproutcms-cms)[crwlr/crawler

Web crawling and scraping library.

37116.4k2](/packages/crwlr-crawler)

PHPackages © 2026

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