pruebadehack/php-simple-html-dom-parser

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

v1.9.1 2022-07-25 20:09 UTC

This package is auto-updated.

Last update: 2024-09-26 01:25:31 UTC


README

版本 1.9.1

为 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": {
    "pruebadehack/php-simple-html-dom-parser": "1.9.1"
    }

用法

use Rygom\PhpSimple\HtmlDomParser;

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

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