Registry / utility / sunra-php-simple-html-dom-parser

sunra-php-simple-html-dom-parser

JSON →
library1.5.2phppackagistunverified

A HTML DOM parser written in PHP5+ that allows jQuery-like selectors and handles invalid HTML.

composer require sunra/php-simple-html-dom-parser
INSTALL
IMPORT
SIG · SUNRA-PHP-SIMPLE-H
S
sunra-php-simple-html-dom-parser
utilityphpv1.5.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HtmlDomParser
use Sunra\PhpSimple\HtmlDomParser;

Parse HTML and extract content using CSS selectors.

use Sunra\PhpSimple\HtmlDomParser; $html = '<html><body><div id="content">Hello</div></body></html>'; $dom = HtmlDomParser::str_get_html($html); $content = $dom->find('#content', 0)->plaintext; echo $content; // Outputs: Hello
Debug
Known issues
gotchaThis library is not actively maintained and may have security issues with malformed HTML.
fix
Consider using a modern parser like Symfony DomCrawler or PHP Masterminds HTML5.
affects: *
Upgrade
Version history
1.5.2latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
sunra-php-simple-html-dom-parser — pip install sunra-php-simple-html-dom-parser · libregistry