PHPackages                             ytekeli/dom-selector - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ytekeli/dom-selector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ytekeli/dom-selector
====================

An HTML DOM selector and extractor with using YAML config.

v0.2.0(5y ago)03MITPHPPHP ^7.3|^8.0

Since Jun 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ytekeli/dom-selector)[ Packagist](https://packagist.org/packages/ytekeli/dom-selector)[ RSS](/packages/ytekeli-dom-selector/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

DOM Selector
============

[](#dom-selector)

[![Latest Version](https://camo.githubusercontent.com/41de86b378f2433d90f38c79cf3a2bdbc79112e490dcc5beaa699fc58c941ecb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7974656b656c692f646f6d2d73656c6563746f72)](https://packagist.org/packages/ytekeli/dom-selector)[![Build Status](https://camo.githubusercontent.com/0526b509a73a3d611837fc993c0a1caac4503a022414efeaf8efc5f08b40da1c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7974656b656c692f646f6d2d73656c6563746f722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://travis-ci.com/ytekeli/dom-selector)[![Code Coverage](https://camo.githubusercontent.com/566466e93ef0fe58bdc1263cbda29db7cebc9906ab1890309f8f2eaac6eacec0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7974656b656c692f646f6d2d73656c6563746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ytekeli/dom-selector/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/80faa40b93f48e57f7a6d1629ecb249f97884f24869b04c85f348e611f618e60/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7974656b656c692f646f6d2d73656c6563746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ytekeli/dom-selector/?branch=master)[![Software License](https://camo.githubusercontent.com/c0f4395b5d77f9397ae00e6af6b19a9c66debb30af293fd2985dd0002634427e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7974656b656c692f646f6d2d73656c6563746f72)](https://github.com/ytekeli/dom-selector/blob/master/LICENSE.md)

An HTML DOM selector and extractor with using YAML config.

- Free software: MIT license

Requirements
------------

[](#requirements)

- PHP ^7.3 | ^8.0
- ext-yaml

Install
-------

[](#install)

Install the latest version using composer.

```
$ composer require ytekeli/dom-selector
```

This package can be found on [packagist](https://packagist.org/packages/ytekeli/dom-selector) and is best loaded using [composer](http://getcomposer.org/). We support php 7.3, 7.4 and 8.0.

Example
-------

[](#example)

You can find many examples of how to use the DOM Selector in the tests directory.

```
// Assuming you installed from Composer:
require "vendor/autoload.php";

use DOMSelector\DOMSelector;

$yaml_string = '
title:
    css: "h1"
    type: Text
link:
    css: "h2 a"
    type: Link';

$selector = DOMSelector::fromYamlString($yaml_string);
$extracted = $selector->extract('TitleUsage ¶');

print_r($extracted);
```

```
// output

Array
(
    [title] => Title
    [link] => https://example.com
)

```

We strongly inspired by [selectorlib](https://github.com/scrapehero/selectorlib) written with python.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

Total

2

Last Release

1832d ago

### Community

Maintainers

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

---

Top Contributors

[![ytekeli](https://avatars.githubusercontent.com/u/855792?v=4)](https://github.com/ytekeli "ytekeli (70 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ytekeli-dom-selector/health.svg)

```
[![Health](https://phpackages.com/badges/ytekeli-dom-selector/health.svg)](https://phpackages.com/packages/ytekeli-dom-selector)
```

###  Alternatives

[lochmueller/seocli

SEO CLI Tool

1113.4k](/packages/lochmueller-seocli)

PHPackages © 2026

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