PHPackages                             skyblack/diz-scraping - 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. skyblack/diz-scraping

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

skyblack/diz-scraping
=====================

Diz Scraping

0.1.3(2y ago)011GPL-3.0-or-laterPHPPHP &gt;=7.4

Since Nov 15Pushed 2y agoCompare

[ Source](https://github.com/SkyBlackHub/Diz-Scraping)[ Packagist](https://packagist.org/packages/skyblack/diz-scraping)[ RSS](/packages/skyblack-diz-scraping/feed)WikiDiscussions master Synced 1mo ago

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

Diz.Scraping
============

[](#dizscraping)

A PHP kit for sending a request and receiving a response over HTTP using the native cURL library.

Simple example:

```
$crawler = new Crawler('sample.com'); // Create a crawler instance with a target site domain - sample.com
$content = $crawler->get('test'); // get a page at https://sample.com/test

$extractor = new Extractor($content); // Create an extractor instance for the result content
$item = $extractor->extract($regexp); // Extract the desired element from the text using some regexp

```

Advanced example:

```
// Create a crawler instance and add a JSON pipe
// The JSON response will be automatically converted to an array
$crawler = (new Crawler('sample.com'))->addJSONPipe();
// Set cookies to be used in the upcoming request
$crawler->addSimpleCookie('user-id', '123');
// Add a permanent custom header data
$crawler->addHeader('Token', 'zxy123gh');

// Create a request instance with a target URL - https://sample.com/post
$request = $crawler->newRequest('post');
// Switch request to POST method and JSON body type
$request->toPOST($data, DataType::JSON);
// Add a custom header data only to this request
$request->addHeader('X-Custom-Data', 'Foo Bar');

$result = $request->send();
// Get actual cookies
$cookies = $crawler->obtainCookies();

```

Although the crawler can be used as is, a more appropriate solution is class inheritance:

```
class MyCrawler extends Crawler
{
    public function __construct()
	{
		parent::__construct('sample.com', 'my'); // https://my.sample.com
		$this->addJSONPipe();
		$this->addCallbackPipe([$this, 'checkResponse']);
	}

	// Add a callback pipe to check the status of the response from the server
	public function checkResponse(array $result): array
	{
		if (($result['status'] ?? null) !== 'ok') {
		   throw new \Exception($result['message'] ?? null);
		}
		return $result['content'];
	}

	public function getItems(string $category): array
	{
	    return $this->get('items', ['category' => $category]);
	}

	// Listen the download event to prevent downloading erroneous files
	protected function onDownloadEvent(DownloadEvent $event): void
	{
		$response = $event->getResponse();

		$status_code = $response->getStatusCode();
		$size = $response->getDownloadSize();
		$destination = $event->getDestination();

		if ($status_code != 200 || $size == 0) {
			unlink($destination);
			if ($status_code == 404) {
				throw new \Exception('File not found.');
			} else {
			    throw new \Exception('File download error.');
			}
		}
    }
}

```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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

Total

4

Last Release

830d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/73e755b9123b40fed5cd15417cd5fcd1e8f9168f38bad39d94a5a014f1434d9e?d=identicon)[Astrodog](/maintainers/Astrodog)

---

Top Contributors

[![AstrodogX](https://avatars.githubusercontent.com/u/20843605?v=4)](https://github.com/AstrodogX "AstrodogX (6 commits)")

---

Tags

crawlercurlhttpscraping

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/skyblack-diz-scraping/health.svg)

```
[![Health](https://phpackages.com/badges/skyblack-diz-scraping/health.svg)](https://phpackages.com/packages/skyblack-diz-scraping)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M318](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M292](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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