PHPackages                             andikamc/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. andikamc/simple-html-dom

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

andikamc/simple-html-dom
========================

03PHP

Since Feb 28Pushed 6y ago1 watchersCompare

[ Source](https://github.com/andikamc/simple-html-dom)[ Packagist](https://packagist.org/packages/andikamc/simple-html-dom)[ RSS](/packages/andikamc-simple-html-dom/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Changelog
=========

[](#changelog)

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

\[1.9.1\] - 2019-10-20
----------------------

[](#191---2019-10-20)

### Fixed

[](#fixed)

- Fixed broken "text" selectors [\#175](https://sourceforge.net/p/simplehtmldom/bugs/175/)

\[1.9\] - 2019-05-30
--------------------

[](#19---2019-05-30)

### Added

[](#added)

- Added unit test for bug reports
    - Added test for bug [\#153](https://sourceforge.net/p/simplehtmldom/bugs/153/)
    - Added test for bug [\#163](https://sourceforge.net/p/simplehtmldom/bugs/163/)
    - Added test for bug [\#166](https://sourceforge.net/p/simplehtmldom/bugs/166/)
    - Added test for bug [\#169](https://sourceforge.net/p/simplehtmldom/bugs/169/)
- Added unit test for character sets UTF-8, CP1251 and CP1252 (#142)
- Added support for meta charset to parse\_charset
- Added detection for CP1251 to parse\_charset, using iconv
- Added LICENSE file (MIT) to the project root
- Added functions to `simple_html_dom_node`
    - `remove`: Removes the current node recursively from the DOM tree
    - `removeChild`: Removes a child node recursively from the DOM tree
    - `hasClass`: Checks if the current node has the specified class name
    - `addClass`: Adds one or more classes to the current node
    - `removeClass`: Removes one or more classes from the current node
    - `save`: Saves the current node to disk

### Changed

[](#changed)

- Changed manual from custom implementation to MkDocs ()

### Fixed

[](#fixed-1)

- Fixed warning when trying to clear() the DOM on a null nodes list (#153)
- Fixed missing whitespace when returning plaintext (#163)
- Fixed broken detection of duplicate attributes (#166)
- Fixed broken detection of CP1252 (ISO-8859-1) documents (#142)
- Fixed error using next-sibling combinator ('E + F') on last child
- Fixed selector parsing for attribute selectors ending on "s" or "i" (#169)

\[1.8.1\] - 2019-01-13
----------------------

[](#181---2019-01-13)

### Fixed

[](#fixed-2)

- Fixed various bugs related to parsing classes and ids

\[1.8\] - 2019-01-13
--------------------

[](#18---2019-01-13)

### Added

[](#added-1)

- Added documentation for `simple_html_dom_node::find`
- Added documentation for `simple_html_dom_node::parse_selector`
- Added documentation for `simple_html_dom_node::seek`
- Added documentation for `simple_html_dom_node::match`
- Added unit tests for bug reports
    - Added test for bug [\#62](https://sourceforge.net/p/simplehtmldom/bugs/62/)
    - Added test for bug [\#79](https://sourceforge.net/p/simplehtmldom/bugs/79/)
    - Added test for bug [\#144](https://sourceforge.net/p/simplehtmldom/bugs/144/)
- Added unit tests for CSS selectors
- Added ability to define constants before simple\_html\_dom does
    - 'DEFAULT\_TARGET\_CHARSET'
    - 'DEFAULT\_BR\_TEXT'
    - 'DEFAULT\_SPAN\_TEXT'
    - 'MAX\_FILE\_SIZE'
- Added support for CSS combinators
    - Added support for Child Combinator (`>`)
    - Added support for Next Sibling Combinator (`+`)
    - Added support for Subsequent Sibling Combinator (`~`)
- Added support for multiclass selectors (`.class.class.class`)
- Added support for multiattribute selectors (`[attr1][attr2][attribute3]`)
- Added support for attribute selectors
    - Added support for pipe selectors (`|=`)
    - Added support for tilde selectors (`~=`)
    - Added support for case sensitivity selectors (`i` and `s`)
- Added unit tests for PHP compatibility to PHP 5.6+
- Added coding standard using PHP\_CodeSniffer

### Changed

[](#changed-1)

- Removed automatic filtering of 'tbody' selectors (#79) > Remove 'tbody' from all selectors to maintain the previous state!
- Coding standard using PHP\_CodeSniffer

### Fixed

[](#fixed-3)

- Fixed broken CSS selector attributes with value "0" (#62)
- Fixed broken simple\_html\_dom::load\_file
- Fixed forward slashes in CSS selector breaks value matching using '\*=' (#144)
- Fixed Universal Selectors

\[1.7\] - 2018-12-10
--------------------

[](#17---2018-12-10)

### Added

[](#added-2)

- Added code documentation to improve readability
- Added unit tests for `simple_html_dom::$self_closing_tags`
- Added unit tests for `simple_html_dom::$optional_closing_tags`
- Added unit tests for bug reports
    - Added test for bug [\#56](https://sourceforge.net/p/simplehtmldom/bugs/56/)
    - Added test for bug [\#97](https://sourceforge.net/p/simplehtmldom/bugs/97/)
    - Added test for bug [\#116](https://sourceforge.net/p/simplehtmldom/bugs/116/)
    - Added test for bug [\#121](https://sourceforge.net/p/simplehtmldom/bugs/127/)
    - Added test for bug [\#127](https://sourceforge.net/p/simplehtmldom/bugs/127/)
    - Added test for bug [\#154](https://sourceforge.net/p/simplehtmldom/bugs/154/)
    - Added test for bug [\#160](https://sourceforge.net/p/simplehtmldom/bugs/160/)
- Added unit tests for memory management of the parser
- Added bit flags to `simple_html_dom::load()`
    - Added bit flag `HDOM_SMARTY_AS_TEXT` to optionally filter Smarty scripts (#154)
        **Note**: Smarty scripts are no longer filtered by default!\\
- Added build script to automate releases
- Added support for attributes without whitespace to separate them

### Changed

[](#changed-2)

- Improved documentation and readability for `$self_closing_tags`
- Improved documentation and readability for `$block_tags`
- Improved documentation and readability for `$optional_closing_tags`
- Updated list of `simple_html_dom::$self_closing_tags`
    - Removed 'spacer' (obsolete)
    - Added 'area'
    - Added 'col'
    - Added 'meta'
    - Added 'param'
    - Added 'source'
    - Added 'track'
    - Added 'wbr'
- Updated list of `simple_html_dom::$optional_closing_tags`
    - Removed "nobr" (obsolete)
    - Added 'th' as closable element to 'td'
    - Added 'td' as closable element to 'th'
    - Added 'optgroup' with 'optgroup' and 'option' as closable elements
    - Added 'optgroup' as closable element to 'option'
    - Added 'rp' with 'rp' and 'rt' as closable elements
    - Added 'rt' with 'rt' and 'rp' as closable elements
- Clarified meaning of `simple_html_dom->parent`
- Changed default `$offset` for `file_get_html()` from -1 to 0 (#161)
- Changed `simple_html_dom::load()` to remove script tags before replacing newline characters
- `simple_html_dom_node::text()` no longer adds whitespace to top level span elements (only to sub-elements)
- `simple_html_dom_node::text()` adds blank lines between paragraphs
- Normalized line endings in the repository to LF via `.gitattributes`
- Improved performance of `simple_html_dom::parse_charset()` by approximately 25%
- Improved performance of `simple_html_dom::parse()` by approximately 10%

### Deprecated

[](#deprecated)

- `str_get_html()` is deprecated and should be replaced by `new simple_html_dom()`

### Removed

[](#removed)

- Removed protected function `simple_html_dom::copy_until_char_escaped()`

### Fixed

[](#fixed-4)

- Fixed compatibility issues with PHP 7.3
- Fixed typo (#147)
- Fixed handling of incorrectly escaped text (#160)
- Restore functionality of `$maxLen` in `file_get_html()`
- Fixed load\_file breaks if an error ocurred in another script

\[1.6\] - 2014-05-28
--------------------

[](#16---2014-05-28)

### Added

[](#added-3)

- Added some ability to insert and create nodes
- Add ability to search the "noise" array

\[1.5\] - 2012-09-10
--------------------

[](#15---2012-09-10)

### Added

[](#added-4)

- Added flag: LOCK\_EX while calling "file\_put\_contents()"
- Added support for detecting the source html character set. This is used to convert characters when plaintext is requested.
- Other little fixes and features, too numerous to categorize

### Changed

[](#changed-3)

- Error of "file\_get\_contents()" will be thrown as an exception

### Fixed

[](#fixed-5)

- Fixed the typo of "token\_blank\_t"
- Memory leak fixed

\[1.11\] - 2008-12-14
---------------------

[](#111---2008-12-14)

### Added

[](#added-5)

- Supports xpath generated from Firebug
- New method "dump" of "simple\_html\_dom\_node"
- New attribute "xmltext" of "simple\_html\_dom\_node"

### Changed

[](#changed-4)

- Remove preg\_quote on selector match function: `[attribute*=value]`
- Element "Comment" will treat as children

### Fixed

[](#fixed-6)

- Fixed the problem with ``
- Fixed bug #2207477 (does not load some pages properly)
- Fixed bug #2315853 (Error with character after &lt; sign)

\[1.10\] - 2008-10-25
---------------------

[](#110---2008-10-25)

### Changed

[](#changed-5)

- Negative indexes supports of "find" method, thanks for Vadim Voituk
- Constructor with automatically load contents either text or file/url, thanks for Antcs
- Fully supports wildcard in selectors

### Fixed

[](#fixed-7)

- Fixed bug of confusing by the &lt; symbol inside the text
- Fixed bug of dash in selectors
- Fixed bug of ``
- Fixed bug #2155883 (Nested List Parses Incorrectly)
- Fixed bug #2155113 (error with unclosed html tags)

\[1.00\] - 2008-09-05
---------------------

[](#100---2008-09-05)

### Added

[](#added-6)

- New method "getAllAttributes" of "simple\_html\_dom\_node"
- Supports full javascript string in selector: `$e->find("a[onclick=alert('hello')]")`

### Changed

[](#changed-6)

- Changed selector "\*=" to case-insentive

### Fixed

[](#fixed-8)

- Fixed the bug of selector in some critical conditions
- Fixed the bug of striping php tags
- Fixed the bug of remove\_noise()
- Fixed the bug of noise in attributes

\[0.99\] - 2008-08-03
---------------------

[](#099---2008-08-03)

### Changed

[](#changed-7)

- Performance tuning (boost 10%)
- Memory requirement reduced by 25%
- Changed function name from "file\_get\_dom()" to "file\_get\_html()"
- Changed function name from "str\_get\_dom()" to "str\_get\_html()"

### Fixed

[](#fixed-9)

- Fixed bug #2011286 (Error with unclosed html tags)
- Fixed bug #2012551 (Error parsing divs)
- Fixed bug #2020924 (Error for missed tag)
- Fixed bug (problem with `` tag's innertext)

\[0.98\] - 2008-06-24
---------------------

[](#098---2008-06-24)

### Added

[](#added-7)

- Supports "multiple class" selector feature: ``
- New "callback function" feature
- New "multiple selectors" feature: $dom-&gt;find('p,a,b')
- New examples
- Supports extract contents from HTML features: $dom-&gt;plaintext

### Changed

[](#changed-8)

- Performance tuning (boost 20%)
- Changed simple\_html\_dom\_node method name from "text()" to "makeup()"

### Fixed

[](#fixed-10)

- Fixed the bug of $dom-&gt;clear()
- Fixed the bug of text nodes' innertext
- Fixed the bug of comment nodes' innertext
- Fixed the bug of decendent selector with optional tags

\[0.97\] - 2008-05-09
---------------------

[](#097---2008-05-09)

### Added

[](#added-8)

- New node type "comment" (eg. $dom-&gt;find('comment'))
- Add self-closing tags: 'base', 'spacer'
- New example "simple\_html\_dom\_utility.php"

### Changed

[](#changed-9)

- File and class name changed (html\_dom\_parser-&gt;simple\_html\_dom)

### Removed

[](#removed-1)

- ($dom-&gt;save\_file) will not support anymore
- Remove example "example\_customize\_parser.php"

### Fixed

[](#fixed-11)

- Fixed the bug of outertext (th)
- Fixed the bug of regular expression escaping chars ($dom-&gt;find)
- Fixed the bug while line-breaker and "\\t" in tags

\[0.96\] - 2008-04-27
---------------------

[](#096---2008-04-27)

### Added

[](#added-9)

- Reference section in manual
- Added traverse section in manual
- Added the solution while server behind proxy in FAQ (Thanks to Yousuke Shaggy)
- New method to remove attribute.
- New DOM operations(first\_child, last\_child, next\_sibling, previous\_sibling) (Request #1936000)

### Changed

[](#changed-10)

- Now file\_get\_dom supports full file\_get\_contents parameters

### Fixed

[](#fixed-12)

- Fixed the bug of self-closing tags in the end of file
- Fixed the bug of blanks in the end of tag
- Fixed some typo of testcase

\[0.95\] - 2008-04-13
---------------------

[](#095---2008-04-13)

### Added

[](#added-10)

- Supports tag name with namespace

### Changed

[](#changed-11)

- New attribute filters (Thanks to Yousuke Kumakura)
- Refine structure of testcase

### Fixed

[](#fixed-13)

- Fix the bug of optional-closing tags
- Fix the bug of parsing the line break next to the tag's name

\[0.94\] - 2008-04-06
---------------------

[](#094---2008-04-06)

### Added

[](#added-11)

- Add FAQ section in manual

### Fixed

[](#fixed-14)

- Fixed infinity loop while the source content is BAD HTML
- Fixed the bug of adding new attributes to self closing tags
- Fixed the bug of customize parser without $dom-&gt;remove\_noise()

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5bd53a460a7223214c2f20e02755cac5f81756e85430e3f819ea7b9310daa266?d=identicon)[andikamc](/maintainers/andikamc)

---

Top Contributors

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

### Embed Badge

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

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

PHPackages © 2026

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