Search by

helturkey / php-webtrawler

helturkey

A PHP-first web scraping and crawling toolkit with adaptive extraction, concurrent spiders, and optional browser automation.

Package info

github.com/helturkey/php-webtrawler

pkg:composer/helturkey/php-webtrawler

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-11-24 14:17 UTC

This package is auto-updated.

Last update: 2026-11-24 14:36:41 UTC


README

PHP Scraper is a PHP-first web scraping toolkit for HTTP fetching, DOM parsing, adaptive element matching, concurrent crawling, optional Chromium rendering, structured exports, a CLI, an MCP server, and Laravel integration.

Documentation

Choose your language:

The documentation covers installation, fetching and parsing, HTTP security, adaptive selectors, spiders and resumability, transports and proxies, Playwright, CLI/MCP, Laravel, exporters, Docker deployment and CI, testing, troubleshooting, and API entry points.

Install

composer require helturkey/php-webtrawler

The core requires PHP 8.4+ and ext-dom, ext-json, ext-libxml, and ext-xmlwriter. Playwright, php-rnet, and Impity are optional integrations with additional requirements. See English requirements or المتطلبات بالعربية.

Minimal example

<?php

declare(strict_types=1);

use HElturkey\WebTrawler\Options\FetchOptions;
use HElturkey\WebTrawler\Scraper;

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

$options = new FetchOptions(
    blockPrivateNetworks: true,
    allowedHosts: ['example.com'],
    maxBodyBytes: 10 * 1024 * 1024,
);

$scraper = Scraper::create(
    defaultOptions: $options,
    enforceDefaultSecurity: true,
);

$page = $scraper->get('https://example.com/');
echo $page->title() ?? 'Untitled';

Security note

For untrusted URLs, configure blockPrivateNetworks, an appropriate allowedHosts list, finite timeouts and a finite response-size limit, and set enforceDefaultSecurity: true. HTTP-level URL checks do not fully prevent DNS rebinding. Playwright routing is best-effort and is not a complete SSRF boundary; use network-level egress isolation for untrusted browser targets. See HTTP security and browser security.

Docker

The production runtime and unified AMD64 CI image are built from one Dockerfile. Run the complete Docker validation with:

composer test-docker

See the Docker deployment and CI guide or الدليل العربي.

Development checks

composer validate --strict
composer cs
composer stan
composer test
composer check

Optional integration commands and the full release checklist are documented in Testing and release and الاختبارات والإصدار.

Project links