leuleu/php-simple-html-dom-parser

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

dev-master 2021-01-27 08:17 UTC

This package is not auto-updated.

Last update: 2024-10-02 23:37:04 UTC


README

版本 1.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.

使用说明

use Leuleu\PhpSimple\HtmlDomParser;

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

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