PHPackages                             andig/php-html-parser - 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. andig/php-html-parser

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

andig/php-html-parser
=====================

Refactored repack of https://github.com/hkk12369/php-html-parser

210.7k↑241.7%1PHP

Since Jan 21Pushed 12y ago1 watchersCompare

[ Source](https://github.com/andig/php-html-parser)[ Packagist](https://packagist.org/packages/andig/php-html-parser)[ RSS](/packages/andig-php-html-parser/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP HTML Parser
===============

[](#php-html-parser)

Build status: [![Build status](https://camo.githubusercontent.com/99f4ab3b3ceee7a705d8b8f137bf7ef42a2256b7b8fd9cac99758a505239721f/68747470733a2f2f7472617669732d63692e6f72672f616e6469672f7068702d68746d6c2d7061727365722e706e67)](https://travis-ci.org/andig/php-html-parser)

A simple and efficient DOMDocument based PHP HTML and XML Parser. It accepts both css selector and xpath queries to search the document and handles malformed HTML as well.

Example:

```
$html = HtmlParser::from_string('Some Text');
$text = $html->find('#outer .red', 0)->text;
echo $text;   // outputs "Some Text"
```

### Authors

[](#authors)

Originally source code taken from . Test cases and refactoring for composer/packagist by .

### Installation via Composer

[](#installation-via-composer)

Define the following requirement in your composer.json file:

```
{
    "require": {
        "andig/php-html-parser": "dev-master"
    }
}
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

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

### Community

Maintainers

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

---

Top Contributors

[![hkk12369](https://avatars.githubusercontent.com/u/362021?v=4)](https://github.com/hkk12369 "hkk12369 (13 commits)")[![andig](https://avatars.githubusercontent.com/u/184815?v=4)](https://github.com/andig "andig (3 commits)")

### Embed Badge

![Health badge](/badges/andig-php-html-parser/health.svg)

```
[![Health](https://phpackages.com/badges/andig-php-html-parser/health.svg)](https://phpackages.com/packages/andig-php-html-parser)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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