alc / dom-parser-helper
PHP Simple HTML DOM Parser Helper
Installs: 2 673
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: ^7.2.5
- guzzlehttp/guzzle: ^7.3
- kub-at/php-simple-html-dom-parser: ^1.9
README
PHP Simple HTML DOM Parser Helper
Install via composer
composer require alc/dom-parser-helper
Usage
require __DIR__.'/vendor/autoload.php'; use Alc\HtmlDomParserHelper; $helper = new HtmlDomParserHelper(); $parser = $helper->parse('http://www.lemonde.fr/'); // Get curl informations (status code, etc..) print_r( $helper->getResponse()->getInfos() ); // Get page title var_dump( $helper->getPageTitle() ); // Get page description var_dump( $helper->getPageDescription() ); // Get favicon url var_dump( $helper->getPageFavicon() ); // Get canonical url var_dump( $helper->getPageCanonical() ); // Get all metas info print_r( $helper->getPageMetas() ); // Get rss feeds print_r( $helper->getPageFeeds() ); // Get all urls print_r( $helper->findAllUrls() ); // Get the php-simple-html-dom-parser $nodes = $parser->find('a'); foreach( $nodes as $node ) { echo $node->innertext, "\n"; } // Clean memory $helper->clear();