PHPackages                             ne0bot/php-dom-wrapper - 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. ne0bot/php-dom-wrapper

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

ne0bot/php-dom-wrapper
======================

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

0.7.3(8y ago)015BSD-3-ClausePHPPHP &gt;=5.5.9

Since May 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ne0bot/php-dom-wrapper)[ Packagist](https://packagist.org/packages/ne0bot/php-dom-wrapper)[ Docs](https://github.com/scotteh/php-dom-wrapper)[ RSS](/packages/ne0bot-php-dom-wrapper/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (4)Versions (15)Used By (0)

PHP DOM Wrapper
===============

[](#php-dom-wrapper)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/cd4b6eeb370958ce472c7661a53d7de9c7a66b93c1235577feec88150673cdc1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73636f747465682f7068702d646f6d2d777261707065722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/scotteh/php-dom-wrapper/?branch=master) [![Build Status](https://camo.githubusercontent.com/8d1263997bc6efc0c5235a7430d96c0069977fbe7a97b10724b4efa31cd46379/68747470733a2f2f7472617669732d63692e6f72672f73636f747465682f7068702d646f6d2d777261707065722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/scotteh/php-dom-wrapper)

Intro
-----

[](#intro)

PHP DOM Wrapper is a simple DOM wrapper library to manipulate and traverse HTML documents. Based around jQuery's manipulation and traversal methods, largely mimicking the behaviour of it's jQuery counterparts.

Author
------

[](#author)

- Andrew Scott ()

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

[](#requirements)

- PHP 5.4 or later
- PSR-4 compatible autoloader

Install
-------

[](#install)

This library is designed to be installed via [Composer](https://getcomposer.org/doc/).

Add the dependency into your projects composer.json.

```
{
  "require": {
    "scotteh/php-dom-wrapper": "dev-master"
  }
}

```

Download the composer.phar

```
curl -sS https://getcomposer.org/installer | php
```

Install the library.

```
php composer.phar install
```

Autoloading
-----------

[](#autoloading)

This library requires an autoloader, if you aren't already using one you can include [Composers autoloader](https://getcomposer.org/doc/01-basic-usage.md#autoloading).

```
require('vendor/autoload.php');
```

Methods
-------

[](#methods)

### Manipulation

[](#manipulation)

MethodImplementedaddClass**Yes**after**Yes**append**Yes**attr**Yes**before**Yes**clone**Yes**detach**Yes**empty**Yes**hasClass**Yes**html**Yes**prepend**Yes**remove**Yes**removeAttr**Yes**removeClass**Yes**replaceWith**Yes**text**Yes**unwrap**Yes**wrap**Yes**wrapAll**Yes**wrapInner**Yes**### Traversal

[](#traversal)

MethodImplementedMethod Name *(if different)*add**Yes**children**Yes**closest**Yes**contents**Yes**eq**Yes**filter**Yes**find**Yes**first**Yes**has**Yes**is**Yes**last**Yes**map**Yes**next**Yes***following*nextAll**Yes***followingAll*nextUntil**Yes***followingUntil*not**Yes**parent**Yes**parents**Yes**parentsUntil**Yes**prev**Yes***preceding*prevAll**Yes***precedingAll*prevUntil**Yes***precedingUntil*siblings**Yes**slice**Yes**Additional Methods:

- count()
- each()

Usage
-----

[](#usage)

Example #1:

```
use DOMWrap\Document;

$html = 'FirstSecondThird';

$doc = new Document();
$doc->html($html);
$nodes = $doc->find('li');

// Returns '3'
var_dump($nodes->count());

// Append as a child node to each
$nodes->append('!');

// Returns: First!Second!Third!
var_dump($doc->saveHTML($doc));
```

Licensing
---------

[](#licensing)

PHP DOM Wrapper is licensed by Andrew Scott under the BSD 3-Clause License, see the LICENSE file for more details.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~76 days

Recently: every ~177 days

Total

13

Last Release

3103d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.4.0

0.7.0PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/9868f1858853cd4e6ce40f4b41274a44e37b62716f4bd06aaff8e84a14663f29?d=identicon)[ne0bot](/maintainers/ne0bot)

---

Top Contributors

[![ne0bot](https://avatars.githubusercontent.com/u/2814336?v=4)](https://github.com/ne0bot "ne0bot (2 commits)")[![karneds](https://avatars.githubusercontent.com/u/668462?v=4)](https://github.com/karneds "karneds (1 commits)")

---

Tags

parsercsshtmldomwrapper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ne0bot-php-dom-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/ne0bot-php-dom-wrapper/health.svg)](https://phpackages.com/packages/ne0bot-php-dom-wrapper)
```

###  Alternatives

[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)[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)[simplehtmldom/simplehtmldom

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

1921.3M14](/packages/simplehtmldom-simplehtmldom)[rct567/dom-query

DomQuery is a PHP library that allows easy 'jQuery like' DOM traversing and manipulation

134261.0k4](/packages/rct567-dom-query)

PHPackages © 2026

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