tuxonice / php-simple-html-dom-parser
Fork of sunra/php-simple-html-dom-parser with improvements and fixes.
Installs: 163
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 351
pkg:composer/tuxonice/php-simple-html-dom-parser
Requires
- php: ^8.1
- ext-iconv: *
- ext-mbstring: *
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.7
This package is auto-updated.
Last update: 2025-09-19 19:51:32 UTC
README
This package is a fork of sunra/php-simple-html-dom-parser with improvements and fixes. The original work was created by:
- S.C. Chen (http://sourceforge.net/projects/simplehtmldom/)
- Sunra (https://github.com/sunra)
This fork is distributed under the MIT License, same as the original project.
Install
composer require tuxonice/php-simple-html-dom-parser:^2.0
Usage
use Tlab\HtmlDomParser\HtmlDomParser; // Parse from a string $dom = HtmlDomParser::str_get_html($str); // or parse from a file $dom = HtmlDomParser::file_get_html($file_name); // Find elements using CSS selectors $elems = $dom->find($elem_name); // Example: Find all links $links = $dom->find('a'); foreach($links as $link) { echo $link->href . "\n"; }