tje3d / domparser
Installs: 27
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/tje3d/domparser
This package is not auto-updated.
Last update: 2025-10-03 23:51:45 UTC
README
This is a simple DomParser which can parse invalid html too. Edited version of http://simplehtmldom.sourceforge.net/.
Installation
composer require tje3d/domparser
Examples
✔️ Parse a string
$dom = Tje3d\DomParser\DomParser::parse(file_get_contents('url'))
✔️ Query element
$dom->find('.elementClass') // All element's with this class
$dom->find('#myId', 0) // First element with this id
$dom->find('[name=user]')
✔️ Available Functions
innerText, innerHTML, html, getAllAttributes, getAttribute, attr, hasAttribute, parentNode, nextSibling, previousSibling, nodeName