Simple Html Dom Parser for Laravel 4 - Upgarded for higher versions
dizatech/htmldom is a Laravel package for simple html dom parser for laravel 4 - upgarded for higher versions.
It currently has 0 GitHub stars and 3 downloads on Packagist.
Install it with composer require dizatech/htmldom.
Discover more Laravel packages by dizatech
or browse all Laravel packages to compare alternatives.
Last updated
A Htmldom package for Laravel 4 and 5 based on Simple HTML Dom Parser
Add the following line to the require section of composer.json:
{
"require": {
"yangqi/htmldom": "1.0.*"
}
}
config/app.php.'providers' => array(
...
'Yangqi\Htmldom\HtmldomServiceProvider',
...
config/app.php.'aliases' => array(
...
'Htmldom' => 'Yangqi\Htmldom\Htmldom',
...
$html = new \Htmldom('http://www.example.com');
// Find all images
foreach($html->find('img') as $element)
echo $element->src . '<br>';
// Find all links
foreach($html->find('a') as $element)
echo $element->href . '<br>';
See the detailed documentation http://simplehtmldom.sourceforge.net/manual.htm