Looking to hire Laravel developers? Try LaraJobs

htmldom-laravel maintained by stounhandj

Author
Last update
2022/04/06 20:36 (dev-master)
License
Links
Downloads
677

Comments
comments powered by Disqus

HtmlDom-Laravel

Installation

$ composer require stounhandj/htmldom-laravel

Or

{
    "require": {
        "stounhandj/htmldom-laravel": "^1.0.0"
    }
}

Usage

  1. Use following:
use StounhandJ\HtmldomLaravel\Htmldom;

$html = new Htmldom('https://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