rl404/php-simple-html-dom-parser

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

v1.5.4 2019-04-21 08:49 UTC

This package is not auto-updated.

Last update: 2024-09-30 10:36:27 UTC


README

原始版本分支而来。

php-simple-html-dom-parser

版本 1.5.2

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": "1.5.2"
    }

用法

use Sunra\PhpSimple\HtmlDomParser;

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

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