PHPackages                             jiangxianli/simple-html - 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. jiangxianli/simple-html

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

jiangxianli/simple-html
=======================

一款类似于Jquery语法的HTML DOM解析扩展包

1.0.0(8y ago)372PHP

Since Aug 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jiangxianli/SimpleHtml)[ Packagist](https://packagist.org/packages/jiangxianli/simple-html)[ Docs](https://github.com/jiangxianli/SimpleHtml)[ RSS](/packages/jiangxianli-simple-html/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

SimpleHtml
==========

[](#simplehtml)

一款PHP语言开发的HTML DOM解析插件，语法类似于Jquery，基于[simplehtmldom](http://simplehtmldom.sourceforge.net/)做了命名空间的封装。

安装
--

[](#安装)

```
    composer require jiangxianli/simple-html

```

使用
--

[](#使用)

```
//字符串加载
$html = \SimpleHtml\SimpleHtml::str_get_html('从字符串中加载html文档演示');
//URL加载
$html = \SimpleHtml\SimpleHtml::file_get_html('https://baidu.com');
//文件加载
$html = \SimpleHtml\SimpleHtml::file_get_html('/tmp/baidu.html');

//查找html文档中的超链接元素
$a = $html->find('a');

//查找文档中第(N)个超链接，如果没有找到则返回空数组.
$a = $html->find('a', 0);

// 查找id为main的div元素
$main = $html->find('div[id=main]',0);

// 查找所有包含有id属性的div元素
$divs = $html->find('div[id]');

// 查找所有包含有id属性的元素
$divs = $html->find('[id]');

//清除使用
$html->clear();
```

更多使用语法
------

[](#更多使用语法)

- [simPHP Simple HTML DOM Parser Wiki](http://simplehtmldom.sourceforge.net/manual.htm)
- [PHP Simple HTML DOM解析器使用入门](http://www.cnphp.info/php-simple-html-dom-parser-intro.html)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

3203d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f72830a372033133672c4484f44c4747cb4f382ac018a8a5f3bd813b0e2a95f7?d=identicon)[997204035](/maintainers/997204035)

---

Top Contributors

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

---

Tags

html-dom-parserhtml-parserhtml-parser-php-extension

### Embed Badge

![Health badge](/badges/jiangxianli-simple-html/health.svg)

```
[![Health](https://phpackages.com/badges/jiangxianli-simple-html/health.svg)](https://phpackages.com/packages/jiangxianli-simple-html)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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