PHPackages                             me578022/simplehtmldom - 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. me578022/simplehtmldom

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

me578022/simplehtmldom
======================

A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way!

v1.11(9y ago)198911The MIT LicensePHPPHP &gt;=5.2.0

Since Oct 1Pushed 9y agoCompare

[ Source](https://github.com/xc0d3rz/simplehtmldom)[ Packagist](https://packagist.org/packages/me578022/simplehtmldom)[ Docs](http://simplehtmldom.sourceforge.net/)[ RSS](/packages/me578022-simplehtmldom/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (2)Used By (1)

PHP Simple HTML DOM Parser
==========================

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

A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way!

Requirement &amp; Features:
---------------------------

[](#requirement--features)

- 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](http://jquery.com).
- Extract contents from HTML in a single line.

Download &amp; Documents:
-------------------------

[](#download--documents)

- Download latest version form [Sourceforge](http://sourceforge.net/project/showfiles.php?group_id=218559).
- Read [Online Document](http://simplehtmldom.sourceforge.net/manual.htm).

Quick Start:
------------

[](#quick-start)

### Get HTML elements

[](#get-html-elements)

```
// Create DOM from URL or file
$html = file_get_html('http://www.google.com/');

// Find all images
foreach($html->find('img') as $element)
       echo $element->src . '';

// Find all links
foreach($html->find('a') as $element)
       echo $element->href . '';
```

### Modify HTML elements

[](#modify-html-elements)

```
// Create DOM from string
$html = str_get_html('HelloWorld');

$html->find('div', 1)->class = 'bar';

$html->find('div[id=hello]', 0)->innertext = 'foo';

echo $html; // Output: fooWorld
```

### Extract contents from HTML

[](#extract-contents-from-html)

```
// Dump contents (without tags) from HTML
echo file_get_html('http://www.google.com/')->plaintext;
```

### Scraping Slashdot!

[](#scraping-slashdot)

```
// Create DOM from URL
$html = file_get_html('http://slashdot.org/');

// Find all article blocks
foreach($html->find('div.article') as $article) {
    $item['title']     = $article->find('div.title', 0)->plaintext;
    $item['intro']    = $article->find('div.intro', 0)->plaintext;
    $item['details'] = $article->find('div.details', 0)->plaintext;
    $articles[] = $item;
}

print_r($articles);
```

Feedback:
---------

[](#feedback)

- [Feature Request Tracker](http://sourceforge.net/tracker/?group_id=218559&atid=1044040).
- [Bug Tracking System](http://sourceforge.net/tracker/?group_id=218559&atid=1044037).
- [Discussion Forums](http://sourceforge.net/forum/?group_id=218559).
- [Contact Author](mailto:me578022@users.sourceforge.net).

Author:
-------

[](#author)

Author: S.C. Chen () Original idea is from Jose Solorzano's [HTML Parser for PHP 4](http://php-html.sourceforge.net/). Contributions by: Yousuke Kumakura (Attribute Filters)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

3559d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee4e269727f9cc93ae0b0a1a464ef8a1105953a92632e2f00aebd7b1878d4758?d=identicon)[Mohammed Ramli](/maintainers/Mohammed%20Ramli)

---

Tags

htmldomSimple

### Embed Badge

![Health badge](/badges/me578022-simplehtmldom/health.svg)

```
[![Health](https://phpackages.com/badges/me578022-simplehtmldom/health.svg)](https://phpackages.com/packages/me578022-simplehtmldom)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k260.4M293](/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.4k8.1M127](/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.6M64](/packages/sunra-php-simple-html-dom-parser)[kub-at/php-simple-html-dom-parser

PHP Simple HTML DOM Parser with namespace and PHP 7.3 compatible

1526.7M35](/packages/kub-at-php-simple-html-dom-parser)[simplehtmldom/simplehtmldom

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

1891.3M15](/packages/simplehtmldom-simplehtmldom)[scotteh/php-dom-wrapper

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

1482.0M11](/packages/scotteh-php-dom-wrapper)

PHPackages © 2026

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