Skip to content
This repository was archived by the owner on Mar 26, 2022. It is now read-only.

Latest commit

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Htmldom

A Htmldom package for Laravel 4 and 5 based on Simple HTML Dom Parser

Installation

Add the following line to the require section of composer.json:

{
"require": {
"yangqi/htmldom": "1.0.*"
}
}

Laravel 5 Setup (same as Laravel 4)

  1. Add the service provider to config/app.php.
'providers' => array(
...
'Yangqi\Htmldom\HtmldomServiceProvider',
...
  1. Add alias to config/app.php.
'aliases' => array( ...
'Htmldom' => 'Yangqi\Htmldom\Htmldom',
...

Usage

  1. 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

About

A Htmldom package for Laravel 4 based on Simple HTML Dom Parser

Resources

Stars

88 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages