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.2
2021-05-17 18:37 UTC
Requires
- php: ^7.1|^8.0
This package is auto-updated.
Last update: 2024-12-18 02:29:43 UTC
README
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);