php-core/simplehtmldom 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

php-core/simplehtmldom

最新稳定版本:0.0.1

Composer 安装命令:

composer require php-core/simplehtmldom

包简介

A fast, simple and reliable HTML document parser for PHP.

README 文档

README

LICENSE BASIC TESTS PACKAGIST

simplehtmldom is a fast and reliable HTML DOM parser for PHP.

This is a fork of the Simple HTML DOM Parser project which aims to make "composer" compatibility better and clean-up some code, introduce type-safety and generally keep the project up-to-date.

Key features

  • Purely PHP-based DOM parser (no XML extensions required).
  • Works with well-formed and broken HTML documents.
  • Loads webpages, local files and document strings.
  • Supports CSS selectors.

Requirements

simplehtmldom requires PHP 8.1 or higher with ext-iconv enabled. Following extensions enable additional features of the parser:

  • ext-mbstring (recommended)
    Enables better detection for multi-byte documents.
  • ext-curl
    Enables cURL support for the class HtmlWeb.
  • ext-openssl (recommended when using cURL)
    Enables SSL support for cURL.

Installation

composer require php-core/simplehtmldom

Usage

<?php
require_once __DIR__. '/vendor/autoload.php';
use PHPCore\SimpleHtmlDom\HtmlWeb;

$client = new HtmlWeb();
$html = $client->load('https://www.google.com/search?q=simplehtmldom');

// Returns the page title
echo $html->find('title', 0)->plaintext . PHP_EOL;

Find more examples in the installation folder under examples.

Documentation

The documentation for this library is hosted at https://php-core.com/simplehtmldom/

If you want to contribute code to the project, simply do a pull-request towards the project repository.

Authors

License

The source code for simplehtmldom is licensed under the MIT license. For further information read the LICENSE file in the root directory (should be located next to this README file).

Technical notes

simplehtmldom is a purely PHP-based DOM parser that doesn't rely on external libraries like libxml, SimpleXML or PHP DOM. Doing so provides better control over the parsing algorithm and a much simpler API that even novice users can learn to use in a short amount of time.

统计信息

  • 总下载量: 979
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 56
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固