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

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

ejklock/simplehtmldom
=====================

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

2.0-RC2(6y ago)03MITHTMLPHP &gt;=5.6

Since Nov 9Pushed 2y agoCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

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

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

[![LICENSE](https://camo.githubusercontent.com/5fbb06d358806d659abb51a4965eb94fe1249f332983c49fc3ad5d8883a5c151/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73696d706c6568746d6c646f6d2f73696d706c6568746d6c646f6d3f6c6f676f3d676974687562267374796c653d666f722d7468652d6261646765)](https://github.com/simplehtmldom/simplehtmldom/blob/master/LICENSE)[![RELEASE](https://camo.githubusercontent.com/e59c05d9504143f6567eebc2d7d8661ac7c9098cf5034b0681a02ba607819345/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f73696d706c6568746d6c646f6d2f73696d706c6568746d6c646f6d3f6c6162656c3d72656c65617365266c6f676f3d736f75726365666f726765267374796c653d666f722d7468652d6261646765)](https://sourceforge.com/projects/simplehtmldom/files/simplehtmldom/)[![BASIC TESTS](https://camo.githubusercontent.com/39df8985d8b2921885a541de8edde5073e5bb0e6b339d2a57b5bac81d89d8a76/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f73696d706c6568746d6c646f6d2f73696d706c6568746d6c646f6d2f426173696325323054657374733f6c6162656c3d42617369632532305465737473266c6f676f3d676974687562267374796c653d666f722d7468652d6261646765)](https://github.com/simplehtmldom/simplehtmldom/actions/workflows/basic_tests.yml)[![PACKAGIST](https://camo.githubusercontent.com/2e65e30167df525133abcc097d4ba3a273bb21e56357a2315c032ccd3d24ab36/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696d706c6568746d6c646f6d2f73696d706c6568746d6c646f6d3f6c6f676f3d636f6d706f736572267374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/simplehtmldom/simplehtmldom)

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

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 5.6 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)

**Manually**:

Download the latest release from [SourceForge](https://sourceforge.net/projects/simplehtmldom/files/latest) and extract the files in the vendor folder of your project.

**Composer**:

```
composer require simplehtmldom/simplehtmldom
```

**Git**:

```
git clone git://git.code.sf.net/p/simplehtmldom/repository simplehtmldom

```

*Note*: The [GitHub repository](https://github.com/simplehtmldom/simplehtmldom) serves as a mirror for the SourceForge project. We currently accept pull requests and issues only via SourceForge.

Usage
-----

[](#usage)

This example illustrates how to return the page title:

Manually```
