lysice/php-simple-html-dom-parser

Composer适配:一个用PHP5+编写的HTML DOM解析器,让您能够非常容易地操作HTML!需要PHP 5+。支持无效HTML。使用选择器在HTML页面上查找标签,就像jQuery一样。一行代码提取HTML内容。

v1.5.3 2023-01-17 08:02 UTC

This package is auto-updated.

Last update: 2024-09-17 12:03:00 UTC


README

版本 1.5.3 提示:此项目是sunra/php-simple-html-dom-parser的分支。

为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": {
    "lysice/php-simple-html-dom-parser": "1.5.*"
    }

用法

use Sunra\PhpSimple\HtmlDomParser;

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

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