chongyi/php-simple-html-dom-parser

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

v1.5.1 2015-08-25 03:03 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:27:20 UTC


README

版本 1.5

为以下内容进行 Composer 和 PSR-0 兼容性适配:

A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.

http://simplehtmldom.sourceforge.net/

安装

composer.phar

"require": {
    "sunra/php-simple-html-dom-parser": "v1.5.0"
    }

使用

use Sunra\PhpSimple\HtmlDomParser;

...
$dom = HtmlDomParser::str_get_html( $str );
or 
$dom = HtmlDomParser::file_get_html( $file_name );

$elems = $dom->find($elem_name);
...