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.

2.0.1 2019-05-01 14:04 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);