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

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

php-core/simplehtmldom
======================

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

0.0.1(1y ago)1786↓50%MITHTMLPHP &gt;=8.1

Since Dec 9Pushed 1y agoCompare

[ Source](https://github.com/php-core/simplehtmldom)[ Packagist](https://packagist.org/packages/php-core/simplehtmldom)[ Docs](https://github.com/php-core/simplehtmldom)[ RSS](/packages/php-core-simplehtmldom/feed)WikiDiscussions master Synced 1mo ago

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

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

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

[![LICENSE](https://camo.githubusercontent.com/3efe0d7adc9163e27c722983fb1c9a2d2569dc1a087e33938db171eaa4a7776a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7068702d636f72652f73696d706c6568746d6c646f6d3f6c6f676f3d676974687562267374796c653d666f722d7468652d6261646765)](https://github.com/php-core/simplehtmldom/blob/master/LICENSE)[![BASIC TESTS](https://camo.githubusercontent.com/3966bf6ac5aa704aa12d5464ce8619e59420f65d524ef06c295eb83afb562e1f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7068702d636f72652f73696d706c6568746d6c646f6d2f426173696325323054657374733f6c6162656c3d42617369632532305465737473266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765)](https://github.com/php-core/simplehtmldom/actions/workflows/basic_tests.yml)[![PACKAGIST](https://camo.githubusercontent.com/38ac99cd23dab1b0f648b335fa81483034677f94943f044ba6a3094c2bfb4166/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068702d636f72652f73696d706c6568746d6c646f6d3f6c6f676f3d636f6d706f736572267374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/php-core/simplehtmldom)

simplehtmldom is a fast and reliable HTML DOM parser for PHP.

This is a fork of the [Simple HTML DOM Parser project](https://sourceforge.net/p/simplehtmldom) which aims to make "composer" compatibility better and clean-up some code, introduce type-safety and generally keep the project up-to-date.

Key features
------------

[](#key-features)

- Purely PHP-based DOM parser (no XML extensions required).
- Works with well-formed and broken HTML documents.
- Loads webpages, local files and document strings.
- Supports CSS selectors.

Requirements
------------

[](#requirements)

simplehtmldom requires **PHP 8.1 or higher** with [ext-iconv](https://www.php.net/manual/en/book.iconv.php) enabled. Following extensions enable additional features of the parser:

- [ext-mbstring](https://secure.php.net/manual/en/book.mbstring.php) (recommended)
    Enables better detection for multi-byte documents.
- [ext-curl](https://secure.php.net/manual/en/book.curl.php)
    Enables cURL support for the class `HtmlWeb`.
- [ext-openssl](https://secure.php.net/manual/en/book.openssl.php) (recommended when using cURL)
    Enables SSL support for cURL.

Installation
------------

[](#installation)

```
composer require php-core/simplehtmldom
```

Usage
-----

[](#usage)

```
