PHPackages                             rdx/js-dom - 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. rdx/js-dom

ActiveLibrary

rdx/js-dom
==========

JS-like DOM traversal

1.13(1y ago)06.7k↑118.8%3MITPHP

Since Jan 15Pushed 1y agoCompare

[ Source](https://github.com/rudiedirkx/php-js-dom)[ Packagist](https://packagist.org/packages/rdx/js-dom)[ RSS](/packages/rdx-js-dom/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (15)Used By (3)

JS-like DOM traversal in PHP.
-----------------------------

[](#js-like-dom-traversal-in-php)

Uses PHP's native `DOMDocument` and Symfony's `CssSelector`.

```
use rdx\jsdom\Node;

$doc = Node::create(file_get_contents('pathe.html'));

// Find 1 element. Returns Node|null.
$section = $doc->query('section.schedule-simple');

// Find all elements. Returns array.
$movies = $section->queryAll('.schedule-simple__item');
foreach ($movies as $movie) {
	// Every element is a Node.
	$a = $movie->query('h4 > a');

	// Every element has an innerText/textContent.
	$title = $a->getText();

	// Attributes are array access.
	$href = $a['href'];
}

```

Known issues:
-------------

[](#known-issues)

- Won't select cross-current, like `querySelector[All]` does:
    Document: `body > section > div`
    Current: `section`
    Selector: `body div`
    Should match the div, but it doesn't. (jQuery doesn't either.)

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance49

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity71

Established project with proven stability

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

Recently: every ~138 days

Total

14

Last Release

378d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78549c1dc5c83ec0201c9afc66762c6d5bbf770291b12bae5a7a65350f950dba?d=identicon)[rudiedirkx](/maintainers/rudiedirkx)

---

Top Contributors

[![rudiedirkx](https://avatars.githubusercontent.com/u/168024?v=4)](https://github.com/rudiedirkx "rudiedirkx (26 commits)")

### Embed Badge

![Health badge](/badges/rdx-js-dom/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[laravel/browser-kit-testing

Provides backwards compatibility for BrowserKit testing in the latest Laravel release.

5139.4M286](/packages/laravel-browser-kit-testing)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[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)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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