yuwarajshrestha/html-dom-parser

此包是Simple Html Dom Parser库的简单包装。它提供了一种简单的方法来解析HTML并从中提取数据。

v0.0.2 2021-12-09 05:57 UTC

This package is auto-updated.

Last update: 2024-09-09 12:31:36 UTC


README

HtmlDomParser

Total Downloads License

此包是 Simple Html Dom Parser 库的简单包装。

如何使用?

步骤 1:安装包

通过执行命令安装包。

composer require yubarajshrestha/html-dom-parser

步骤 2:实现HtmlDomParser

use YubarajShrestha\HtmlDomParser\Parser;

public function parse_tags()
{
    $html = '<div>
        <ul>
            <li>PHP</li>
            <li>Python</li>
        </ul>
    </div>';

    $parsed = Parser::str_get_html($html);
}

致谢 PHP Simple HTML DOM Parser