growthexponent / laravel-html-dom-parser
Laravel wrapper for the PHP HTML DOM Parser package.
Installs: 261
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 2
Open Issues: 1
pkg:composer/growthexponent/laravel-html-dom-parser
Requires
- php: >=5.5.9
- laravel/framework: 5.1.*
- paquettg/php-html-parser: 1.6.*
Requires (Dev)
- phpunit/phpunit: ~4.4
This package is not auto-updated.
Last update: 2025-10-01 14:01:33 UTC
README
Thin wrapper for https://github.com/paquettg/php-html-parser and provides the public function
$proxy = "120.195.203.43:80"; $proxy = explode(':', $proxy); loadFromUrlByProxy($url, $options = [], CurlInterface $curl = null, $proxy = null)
Installation
Requires
- PHP 5.4+
- Laravel 5.1+
Install via Composer by adding the following line to the require block of your composer.json file
"growthexponent/laravel-html-dom-parser": "1.0.*"
Then run php composer update
Add this line to the providers array in your php app/config/app.php
file:
'LaravelHtmlDomParser\LaravelHtmlDomParserServiceProvider',
Sample Usage
<?php use LaravelHtmlDomParser\LaravelHtmlDomParser; class ...Controller extends Controller { /** * .... * * @return \Illuminate\Http\Response */ public function index() { $parser = new LaravelHtmlDomParser(); $proxy = "120.195.203.43:80"; $proxy = explode(':', $proxy); $html = $parser->loadFromUrlByProxy('http://www.growthexponent.com', [], null, $proxy); dd($html); } }