torann/dom-parser

A HTML DOM parser written in PHP7 let you manipulate HTML in a very easy way! Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.

Installs: 503

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 351

pkg:composer/torann/dom-parser

2.0.2 2021-05-17 18:37 UTC

This package is auto-updated.

Last update: 2025-09-18 03:55:36 UTC


README

Latest Stable Version Total Downloads Patreon donate button Donate weekly to this project using Gratipay Donate to this project using Flattr Donate to this project using Paypal

A HTML DOM parser written in PHP7 let you manipulate HTML in a very easy way! Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.

Usage

From a string:

use Torann\DomParser\HtmlDom;

$dom = HtmlDom::fromString($str);

$elements = $dom->find($el_name);

From a file:

use Torann\DomParser\HtmlDom;

$dom = HtmlDom::fromFile($file_name);

$elements = $dom->find($el_name);