bupychuk/php-simple-html-dom-parser

Composer版本:用PHP5+编写的HTML DOM解析器,让您以非常简单的方式操作HTML!需要PHP 5+。支持无效HTML。使用选择器在HTML页面中查找标签,就像jQuery一样。一行代码即可从HTML中提取内容。

dev-master 2013-04-02 21:54 UTC

This package is not auto-updated.

Last update: 2024-09-14 14:34:49 UTC


README

PHP Simple HTML DOM Parser - Laravel扩展包

从HTML或XML网站或字符串解析数据

您可以使用jQuery选择器语法,更多请参阅文档。

示例

$HDM = IoC::resolve('HtmlDomParser');
// Get from file
$dom = $HDM::file_get_html( 'http://www.google.com/finance/converter' );
// Get from string
$dom = $HDM::str_get_html( '<html><a href="https://laravel.net.cn/"></html>' );

$href = $dom->find('a',0)->href; // = "https://laravel.net.cn/"

php simple html dom 文档