keithiiiiu/php-simple-html-dom-parser

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

dev-master 2022-10-17 16:28 UTC

This package is not auto-updated.

Last update: 2024-10-02 00:14:15 UTC


README

版本 1.5.2

为 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": "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);
...

更新

与以下文件合并:https://github.com/sunra/php-simple-html-dom-parser

composer require keithiiiiu/php-simple-html-dom-parser