kalimeromk / update-htmldom
Simple Html Dom Parser for Laravel
v1
2022-10-10 06:21 UTC
Requires
- php: ^7.3|^7.4|^8.0|^8.1
- ext-iconv: *
This package is auto-updated.
Last update: 2024-11-10 11:10:54 UTC
README
A Htmldom package for Laravel 5 to 9 based on Simple HTML Dom Parser
Installation
Add the following line to the require
section of composer.json
:
composer require kalimeromk/update-htmldom
Laravel 5 Setup
- Add the service provider to
config/app.php
.
'providers' => array( ... 'Htmldom\HtmldomServiceProvider', ...
- Add alias to
config/app.php
.
'aliases' => array( ... 'Htmldom' => 'Htmldom\Htmldom', ...
Usage
- Use following:
$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
s