PHPackages                             ngfw/webparser - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. ngfw/webparser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

ngfw/webparser
==============

WebParser is a PHP library that allows developers to parse and query webpages using an ORM-like syntax. It facilitates the extraction of HTML elements by chaining operations such as filtering by ID or class, ordering results, and limiting output. WebParser offers a flexible interface for exploring and extracting data from the web, making it ideal for web scraping and data analysis tasks.

v1.0.0(1y ago)08MITPHPPHP ^8.0

Since Aug 22Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/ngfw/webparser)[ Packagist](https://packagist.org/packages/ngfw/webparser)[ Docs](https://github.com/ngfw/webparser)[ RSS](/packages/ngfw-webparser/feed)WikiDiscussions master Synced 2d ago

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

WebParser for Laravel
=====================

[](#webparser-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/78882eabe211452c3b80c225876fa63c8edce6adc439d398e58a0ca3f0424ef4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6766772f7765627061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ngfw/webparser)[![Total Downloads](https://camo.githubusercontent.com/c83232c1c7268d0d72de21215b1859322686595d50f7fa38d34a16bde2a3bdd3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6766772f7765627061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ngfw/webparser)

**WebParser** is an ORM-style web scraping package for Laravel, designed to make DOM parsing simple and intuitive. With a fluent, chainable API, WebParser lets you effortlessly navigate, select, and extract data from HTML documents, bringing the ease of database querying to web scraping.

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

[](#installation)

You can install the package via composer:

```
composer require ngfw/webparser
```

Usage
-----

[](#usage)

Here's how you can start using WebParser:

```
use Ngfw\Webparser\Facades\WebParser;

// Initialize WebParser with a URL
$webParser = WebParser::fromUrl('https://laravel.com/');

// Extract the page title
$pageTitle = $webParser->select('text')->where('title')->first();
echo $pageTitle;

// Extract the content of the meta description
$metaDescription = $webParser->whereAttribute('name', 'description')->pluck('content')->first();
echo $metaDescription;

// Extract the first H1 tag's text content
$firstH1 = $webParser->select('text')->where('h1')->first();
echo $firstH1;

// Find an H2 element within a complex class structure and extract its text
$complexH2 = $webParser->where('.relative .max-w-screen-xl .w-full .mx-auto .xl:px-5')->find('h2')->select('text')->first();
echo $complexH2;

// Extract the text from all H2 tags on the page
$allH2Texts = $webParser->select('text')->where('h2')->get();
print_r($allH2Texts);

// Extract the sources (src) of all images on the page
$imageSources = $webParser->where('img')->pluck('src')->all();
print_r($imageSources);
```

### Testing

[](#testing)

To run the tests, use:

```
vendor/bin/phpunit
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security-related issues, please email the author instead of using the issue tracker.

Credits
-------

[](#credits)

- [Nick G](https://github.com/ngfw)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Hire Me
-------

[](#hire-me)

Looking for a Laravel expert to help with your next project? I'm available for freelance work! Feel free to contact me to discuss how I can assist you.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance50

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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

Unknown

Total

1

Last Release

681d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5839764?v=4)[gejadze](/maintainers/gejadze)[@gejadze](https://github.com/gejadze)

---

Top Contributors

[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (2 commits)")[![ngfw](https://avatars.githubusercontent.com/u/203863?v=4)](https://github.com/ngfw "ngfw (2 commits)")

---

Tags

phplaravelweb-scraping ngfwhtml parsingwebparser

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ngfw-webparser/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[ultrono/laravel-sitemap

Sitemap generator for Laravel 11, 12 and 13

37460.0k16](/packages/ultrono-laravel-sitemap)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)

PHPackages © 2026

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