PHPackages                             voku/simple\_html\_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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. voku/simple\_html\_dom

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

voku/simple\_html\_dom
======================

Simple HTML DOM package.

5.0.0(2mo ago)9199.0M↓48.3%11120MITPHPPHP &gt;=7.1.0CI passing

Since Dec 7Pushed 2w ago16 watchersCompare

[ Source](https://github.com/voku/simple_html_dom)[ Packagist](https://packagist.org/packages/voku/simple_html_dom)[ Docs](https://github.com/voku/simple_html_dom)[ Fund](https://www.paypal.me/moelleken)[ GitHub Sponsors](https://github.com/voku)[ RSS](/packages/voku-simple-html-dom/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (4)Versions (159)Used By (20)

[![Build Status](https://github.com/voku/simple_html_dom/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/voku/simple_html_dom/actions)[![Coverage Status](https://camo.githubusercontent.com/ae252de896f5e3960394db461a9ede8ad74f815a4a855a8cecd26ed02539dd19/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f766f6b752f73696d706c655f68746d6c5f646f6d2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/voku/simple_html_dom?branch=master)[![Codacy Badge](https://camo.githubusercontent.com/9e27c006efe45ae0f0843bbadcadce7eccda10cf12ca8ba7f97e30d292de3e45/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3332393066646333356338663439616439616264663035333538323436366562)](https://www.codacy.com/app/voku/simple_html_dom?utm_source=github.com&utm_medium=referral&utm_content=voku/simple_html_dom&utm_campaign=Badge_Grade)[![Latest Stable Version](https://camo.githubusercontent.com/1880378c00f2168f2cc4ee1322907463823182ad2c13759c7762932076e1d61b/68747470733a2f2f706f7365722e707567782e6f72672f766f6b752f73696d706c655f68746d6c5f646f6d2f762f737461626c65)](https://packagist.org/packages/voku/simple_html_dom)[![Total Downloads](https://camo.githubusercontent.com/2f9f3a30c2621f06efa681491dd8680df207b230a9fafaef546faa3aeaa7e797/68747470733a2f2f706f7365722e707567782e6f72672f766f6b752f73696d706c655f68746d6c5f646f6d2f646f776e6c6f616473)](https://packagist.org/packages/voku/simple_html_dom)[![License](https://camo.githubusercontent.com/a8f3a2d20d7198c48540cc36e8e21c864238376fe743c60ec79cf70e8d266230/68747470733a2f2f706f7365722e707567782e6f72672f766f6b752f73696d706c655f68746d6c5f646f6d2f6c6963656e7365)](https://packagist.org/packages/voku/simple_html_dom)[![Donate to this project using Paypal](https://camo.githubusercontent.com/0d6e4d8b50b5983a58205941b1a581b1305903393b7a39da574e3f60af3c7f5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617970616c2d646f6e6174652d79656c6c6f772e737667)](https://www.paypal.me/moelleken)[![Donate to this project using Patreon](https://camo.githubusercontent.com/f9e075baad95563481d35174d43ef50757281abb6bc795d0f473fad452afa030/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617472656f6e2d646f6e6174652d79656c6c6f772e737667)](https://www.patreon.com/voku)

📜 Simple Html Dom Parser for PHP
================================

[](#scroll-simple-html-dom-parser-for-php)

A HTML DOM parser written in PHP - let you manipulate HTML in a very easy way! This is a fork of [PHP Simple HTML DOM Parser project](http://simplehtmldom.sourceforge.net/) but instead of string manipulation we use DOMDocument and modern php classes like "Symfony CssSelector".

- PHP 7.1+ runtime support, tested on PHP 7.1 - 8.4
- PHP-FIG Standard
- Composer &amp; PSR-4 support
- PHPUnit testing via GitHub Actions
- PHPStan-clean source tree on the current release branch
- PHP-Quality testing via SensioLabsInsight
- UTF-8 Support (more support via "voku/portable-utf8")
- Invalid HTML Support (partly ...)
- Find tags on an HTML page with selectors just like jQuery
- Extract contents from HTML in a single line

### Install via "composer require"

[](#install-via-composer-require)

```
composer require voku/simple_html_dom
composer require voku/portable-utf8 # if you need e.g. UTF-8 fixed output
```

### Upgrade notes for v5.0.0

[](#upgrade-notes-for-v500)

- PHP 7.0 is no longer supported; the package now requires PHP 7.1 or newer.
- Nested `find*()` calls now return live nodes scoped to the original DOM, so mutating nested results updates the source document.
- See the [CHANGELOG](https://github.com/voku/simple_html_dom/blob/master/CHANGELOG) for the full release notes.

### Quick Start

[](#quick-start)

```
use voku\helper\HtmlDomParser;

require_once 'composer/autoload.php';

...
$dom = HtmlDomParser::str_get_html($str);
// or
$dom = HtmlDomParser::file_get_html($file);

$element = $dom->findOne('#css-selector'); // "$element" === instance of "SimpleHtmlDomInterface"

$elements = $dom->findMulti('.css-selector'); // "$elements" === instance of SimpleHtmlDomNodeInterface

$elementOrFalse = $dom->findOneOrFalse('#css-selector'); // "$elementOrFalse" === instance of "SimpleHtmlDomInterface" or false

$elementsOrFalse = $dom->findMultiOrFalse('.css-selector'); // "$elementsOrFalse" === instance of SimpleHtmlDomNodeInterface or false
...
```

### Examples

[](#examples)

[github.com/voku/simple\_html\_dom/tree/master/example](https://github.com/voku/simple_html_dom/tree/master/example)

### API

[](#api)

[github.com/voku/simple\_html\_dom/tree/master/README\_API.md](https://github.com/voku/simple_html_dom/tree/master/README_API.md)

### Support

[](#support)

For support and donations please visit [Github](https://github.com/voku/simple_html_dom/) | [Issues](https://github.com/voku/simple_html_dom/issues) | [PayPal](https://paypal.me/moelleken) | [Patreon](https://www.patreon.com/voku).

For status updates and release announcements please visit [Releases](https://github.com/voku/simple_html_dom/releases) | [Twitter](https://twitter.com/suckup_de) | [Patreon](https://www.patreon.com/voku/posts).

For professional support please contact [me](https://about.me/voku).

### Thanks

[](#thanks)

- Thanks to [GitHub](https://github.com) (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc.
- Thanks to [IntelliJ](https://www.jetbrains.com) as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
- Thanks to [Travis CI](https://travis-ci.com/) for being the most awesome, easiest continous integration tool out there!
- Thanks to [StyleCI](https://styleci.io/) for the simple but powerfull code style check.
- Thanks to [PHPStan](https://github.com/phpstan/phpstan) &amp;&amp; [Psalm](https://github.com/vimeo/psalm) for relly great Static analysis tools and for discover bugs in the code!

### License

[](#license)

[![FOSSA Status](https://camo.githubusercontent.com/83ed15bc95699bf514e4c421d8dbb1375d78e2e6909d46f1f2b3b6d316f2cc23/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246766f6b7525324673696d706c655f68746d6c5f646f6d2e7376673f747970653d6c61726765)](https://app.fossa.io/projects/git%2Bgithub.com%2Fvoku%2Fsimple_html_dom?ref=badge_large)

###  Health Score

73

—

ExcellentBetter than 100% of packages

Maintenance91

Actively maintained with recent releases

Popularity69

Solid adoption and visibility

Community46

Growing community involvement

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 70.8% 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 ~34 days

Recently: every ~304 days

Total

123

Last Release

73d ago

Major Versions

1.7.2 → 2.0.0-RC2016-04-01

2.0.31 → 3.0.02017-03-17

3.1.2 → 4.0.02017-11-19

4.8.10 → 5.0.02026-04-21

PHP version history (4 changes)1.5PHP &gt;=5.2.4

1.6.0PHP &gt;=5.3.2

4.0.0PHP &gt;=7.0.0

5.0.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6456fe693db197c458272cb758bf78958bc7d3e787ccd59db4bf3cf41654316a?d=identicon)[voku](/maintainers/voku)

---

Top Contributors

[![voku](https://avatars.githubusercontent.com/u/264695?v=4)](https://github.com/voku "voku (419 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (125 commits)")[![samacs](https://avatars.githubusercontent.com/u/48268?v=4)](https://github.com/samacs "samacs (8 commits)")[![marioquartz](https://avatars.githubusercontent.com/u/3995147?v=4)](https://github.com/marioquartz "marioquartz (8 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (8 commits)")[![devteam-emroc](https://avatars.githubusercontent.com/u/104580363?v=4)](https://github.com/devteam-emroc "devteam-emroc (4 commits)")[![hryvinskyi](https://avatars.githubusercontent.com/u/9294098?v=4)](https://github.com/hryvinskyi "hryvinskyi (3 commits)")[![all9lives](https://avatars.githubusercontent.com/u/1470953?v=4)](https://github.com/all9lives "all9lives (2 commits)")[![eyupcanakman](https://avatars.githubusercontent.com/u/1732357?v=4)](https://github.com/eyupcanakman "eyupcanakman (2 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")[![frugan-dev](https://avatars.githubusercontent.com/u/7957714?v=4)](https://github.com/frugan-dev "frugan-dev (1 commits)")[![GerB](https://avatars.githubusercontent.com/u/444545?v=4)](https://github.com/GerB "GerB (1 commits)")[![flavioheleno](https://avatars.githubusercontent.com/u/471860?v=4)](https://github.com/flavioheleno "flavioheleno (1 commits)")[![FabianMartin](https://avatars.githubusercontent.com/u/390297?v=4)](https://github.com/FabianMartin "FabianMartin (1 commits)")[![nlemoine](https://avatars.githubusercontent.com/u/2526939?v=4)](https://github.com/nlemoine "nlemoine (1 commits)")[![RobertEcker](https://avatars.githubusercontent.com/u/6156052?v=4)](https://github.com/RobertEcker "RobertEcker (1 commits)")[![dora38](https://avatars.githubusercontent.com/u/13598459?v=4)](https://github.com/dora38 "dora38 (1 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (1 commits)")[![DieterHolvoet](https://avatars.githubusercontent.com/u/3606531?v=4)](https://github.com/DieterHolvoet "DieterHolvoet (1 commits)")[![tpruvot](https://avatars.githubusercontent.com/u/145119?v=4)](https://github.com/tpruvot "tpruvot (1 commits)")

---

Tags

domhacktoberfesthtml-dom-parserhtml-parserphpxmlxml-parserdomHTML Parserphp dom

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k269.7M322](/packages/masterminds-html5)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[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.5k8.2M130](/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.7M65](/packages/sunra-php-simple-html-dom-parser)[sabre/xml

sabre/xml is an XML library that you may not hate.

55234.6M141](/packages/sabre-xml)[scotteh/php-dom-wrapper

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

1512.0M12](/packages/scotteh-php-dom-wrapper)

PHPackages © 2026

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