PHPackages                             xparse/element-finder - 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. xparse/element-finder

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

xparse/element-finder
=====================

Elegant data scrapping

3.0.1(4mo ago)3445.0k↑46.2%14[3 PRs](https://github.com/xparse/ElementFinder/pulls)2MITPHPPHP ^8.2CI passing

Since Dec 12Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/xparse/ElementFinder)[ Packagist](https://packagist.org/packages/xparse/element-finder)[ Docs](https://github.com/xparse/ElementFinder)[ RSS](/packages/xparse-element-finder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (5)Versions (25)Used By (2)

ElementFinder
=============

[](#elementfinder)

[![Latest Version](https://camo.githubusercontent.com/e22edd1da81da7a7832019486a2358ffea83887e600b9e9df806eb00f734094f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7870617273652f656c656d656e742d66696e6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xparse/element-finder)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![CI](https://github.com/xparse/ElementFinder/actions/workflows/test.yaml/badge.svg)](https://github.com/xparse/ElementFinder/actions/workflows/test.yaml)[![codecov](https://camo.githubusercontent.com/0b6d0b4a4a173bdd27788cf5bae09c0409cda8a97de206067d76b5fc87fe838a/68747470733a2f2f636f6465636f762e696f2f6769746875622f7870617273652f456c656d656e7446696e6465722f67726170682f62616467652e7376673f746f6b656e3d79596e7572706f797841)](https://codecov.io/github/xparse/ElementFinder)[![Total Downloads](https://camo.githubusercontent.com/f65b64f9d8df724b617f2c4530c732d1d805f95f2b0c360fe967351f3aa89306/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7870617273652f656c656d656e742d66696e6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xparse/element-finder)

Extract data from html with elegant xpath/css expressions and prepare data with regexp in single line.

Install
-------

[](#install)

Via Composer

```
$ composer require xparse/element-finder
```

Usage
-----

[](#usage)

```
  $page = new ElementFinder($html);
  $title = $page->value('//title')->first();
  echo $title;
```

Advanced usage with regexp
--------------------------

[](#advanced-usage-with-regexp)

```
$page = new \Xparse\ElementFinder\ElementFinder('

    044-12-12,
    258-16-16

    (148) 04-55-16

 ');

  $tels = $page->value('//*[@class="tels"]')->split('!,!')->replace("![^0-9]!");
  print_r($tels);

  /*
    [0] => 0441212
    [1] => 2581616
    [2] => 148045516
  */

```

Css selectors
-------------

[](#css-selectors)

Read this document. [Using css selectors](doc/using_css_selectors.md).

Testing
-------

[](#testing)

```
  ./vendor/bin/phpunit
```

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/xparse/ElementFinder/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [funivan](https://github.com/funivan)
- [All Contributors](https://github.com/xparse/ElementFinder/contributors)

Xpath info
----------

[](#xpath-info)

- [XPath/CSS Equivalents](https://en.wikibooks.org/wiki/XPath/CSS_Equivalents)
- [Choose between XPath and jQuery with an XPath-jQuery phrase book](http://www.ibm.com/developerworks/library/x-xpathjquery/)
- [XPath and CSS Selectors](http://ejohn.org/blog/xpath-css-selectors/)

License
-------

[](#license)

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

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance84

Actively maintained with recent releases

Popularity41

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~422 days

Total

22

Last Release

124d ago

Major Versions

0.5.1-alpha → 1.0.02021-05-31

1.0.1 → 2.0.02024-01-11

2.0.0 → 3.0.02025-02-08

PHP version history (8 changes)0.0.1PHP &gt;=5.3.0

0.0.3PHP &gt;=5.5.0

0.1.0-alpha1PHP &gt;=5.6

0.1.0-alpha.5PHP ^7.0

0.5.0PHP ^7.1

0.5.1-alphaPHP ^7.3 || ^8.0

2.0.0PHP ^8.1

3.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ee14f8f97b3ead4c91823e410ea170293b55be64adf12a20d965f19008839a6?d=identicon)[funivan](/maintainers/funivan)

---

Top Contributors

[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (168 commits)")[![funivan](https://avatars.githubusercontent.com/u/425208?v=4)](https://github.com/funivan "funivan (123 commits)")[![ganchclub](https://avatars.githubusercontent.com/u/7393570?v=4)](https://github.com/ganchclub "ganchclub (40 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (17 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (12 commits)")[![saintdron](https://avatars.githubusercontent.com/u/23000680?v=4)](https://github.com/saintdron "saintdron (11 commits)")[![SergeiMV](https://avatars.githubusercontent.com/u/92272880?v=4)](https://github.com/SergeiMV "SergeiMV (6 commits)")[![maxKuk](https://avatars.githubusercontent.com/u/25341044?v=4)](https://github.com/maxKuk "maxKuk (6 commits)")[![komendant-dev](https://avatars.githubusercontent.com/u/23610816?v=4)](https://github.com/komendant-dev "komendant-dev (4 commits)")[![ChrisGalliano](https://avatars.githubusercontent.com/u/17964229?v=4)](https://github.com/ChrisGalliano "ChrisGalliano (3 commits)")[![akravets12](https://avatars.githubusercontent.com/u/25844438?v=4)](https://github.com/akravets12 "akravets12 (2 commits)")[![AndreyLM](https://avatars.githubusercontent.com/u/13957968?v=4)](https://github.com/AndreyLM "AndreyLM (1 commits)")[![sevikerr](https://avatars.githubusercontent.com/u/10178868?v=4)](https://github.com/sevikerr "sevikerr (1 commits)")

---

Tags

css-selectordomgrabberparserphpregexpxpathparserdomXpath

###  Code Quality

TestsPHPUnit

Static AnalysisRector

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/xparse-element-finder/health.svg)

```
[![Health](https://phpackages.com/badges/xparse-element-finder/health.svg)](https://phpackages.com/packages/xparse-element-finder)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[paquettg/php-html-parser

An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.

2.4k7.9M123](/packages/paquettg-php-html-parser)[sunra/php-simple-html-dom-parser

Composer adaptation of: A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.

1.3k9.4M61](/packages/sunra-php-simple-html-dom-parser)[scotteh/php-dom-wrapper

Simple DOM wrapper to select nodes using either CSS or XPath expressions and manipulate results quickly and easily.

1471.9M10](/packages/scotteh-php-dom-wrapper)[veewee/xml

XML without worries

1835.9M29](/packages/veewee-xml)[simplehtmldom/simplehtmldom

A fast, simple and reliable HTML document parser for PHP.

1921.3M14](/packages/simplehtmldom-simplehtmldom)

PHPackages © 2026

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