PHPackages                             pmvc-plugin/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. pmvc-plugin/html\_parser

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

pmvc-plugin/html\_parser
========================

HTML parser

0.1.11(8y ago)04991MITPHP

Since Apr 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/pmvc-plugin/html_parser)[ Packagist](https://packagist.org/packages/pmvc-plugin/html_parser)[ RSS](/packages/pmvc-plugin-html-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/d34c0f4ccae903802e6c51da079f3c80f04410f2c83dfbb12b097895b588e13a/68747470733a2f2f706f7365722e707567782e6f72672f706d76632d706c7567696e2f68746d6c5f7061727365722f762f737461626c65)](https://packagist.org/packages/pmvc-plugin/html_parser)[![Latest Unstable Version](https://camo.githubusercontent.com/8e55c85d12579055db6dbb0cd362258f433207276a9bdfbc9796ab3c0231c97d/68747470733a2f2f706f7365722e707567782e6f72672f706d76632d706c7567696e2f68746d6c5f7061727365722f762f756e737461626c65)](https://packagist.org/packages/pmvc-plugin/html_parser)[![Build Status](https://camo.githubusercontent.com/270470fece522a14df5f90a533d345bee03f8136f49249f39296b1bd87d90e1d/68747470733a2f2f7472617669732d63692e6f72672f706d76632d706c7567696e2f68746d6c5f7061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/pmvc-plugin/html_parser)[![License](https://camo.githubusercontent.com/899b695207866e6b459bb6148fb7e756943ff24d846d30b1b90fe6131e28a253/68747470733a2f2f706f7365722e707567782e6f72672f706d76632d706c7567696e2f68746d6c5f7061727365722f6c6963656e7365)](https://packagist.org/packages/pmvc-plugin/html_parser)[![Total Downloads](https://camo.githubusercontent.com/95b43123b3c66fe5fea1cb4beaa9491566adbfd6ec16ad6738bd48a801e5c6fd/68747470733a2f2f706f7365722e707567782e6f72672f706d76632d706c7567696e2f68746d6c5f7061727365722f646f776e6c6f616473)](https://packagist.org/packages/pmvc-plugin/html_parser)

Html Parser
===========

[](#html-parser)

How to use?
-----------

[](#how-to-use)

public function css($content, $selector)

```
include('vendor/autoload.php');
PMVC\Load::plug();
$plug = \PMVC\plug('html_parser');
$object = $plug->css($html, $your_css_$selector);
var_dump($object->html());

```

Useful tip
----------

[](#useful-tip)

### text or html

[](#text-or-html)

- object-&gt;text()
- object-&gt;html()

### get tag attribute

[](#get-tag-attribute)

- object-&gt;attr('href')

### Process a list (QueryPath)

[](#process-a-list-querypath)

- [https://web.archive.org/web/20120504094800/http://api.querypath.org/docs/class\_query\_path.html](https://web.archive.org/web/20120504094800/http://api.querypath.org/docs/class_query_path.html)
- Get one index

```
   $DOMElement = QueryPath->get(int index)                  // start from zero
   \PMVC\plug('html_parser')->css($DOMElement, $selector);

```

### Parse Engine

[](#parse-engine)

- Old Api(better):
    -
-

Install with Composer
---------------------

[](#install-with-composer)

### 1. Download composer

[](#1-download-composer)

- mkdir test\_folder
- curl -sS  | php

### 2. Install Use composer.json or use command-line directly

[](#2-install-use-composerjson-or-use-command-line-directly)

#### 2.1 Install Use composer.json

[](#21-install-use-composerjson)

- vim composer.json

```
{
    "require": {
        "pmvc-plugin/html_parser": "dev-master"
    }
}

```

- php composer.phar install

#### 2.2 Or use composer command-line

[](#22-or-use-composer-command-line)

- php composer.phar require pmvc-plugin/html\_parser

or

- composer require pmvc-plugin/html\_parser

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

2949d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f593111e77142a10224458b0436e6b2d6f3e537f924c03130f0208bd3c4477f?d=identicon)[HillLiu](/maintainers/HillLiu)

---

Top Contributors

[![HillLiu](https://avatars.githubusercontent.com/u/1877738?v=4)](https://github.com/HillLiu "HillLiu (23 commits)")

---

Tags

plug-inpmvcHTML Parser

### Embed Badge

![Health badge](/badges/pmvc-plugin-html-parser/health.svg)

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

###  Alternatives

[voku/simple_html_dom

Simple HTML DOM package.

9188.3M63](/packages/voku-simple-html-dom)

PHPackages © 2026

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