ytekeli/dom-selector 问题修复 & 功能扩展

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

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

ytekeli/dom-selector

Composer 安装命令:

composer require ytekeli/dom-selector

包简介

An HTML DOM selector and extractor with using YAML config.

README 文档

README

Latest Version Build Status Code Coverage Scrutinizer Code Quality Software License

An HTML DOM selector and extractor with using YAML config.

  • Free software: MIT license

Requirements

  • PHP ^7.3 | ^8.0
  • ext-yaml

Install

Install the latest version using composer.

$ composer require ytekeli/dom-selector

This package can be found on packagist and is best loaded using composer. We support php 7.3, 7.4 and 8.0.

Example

You can find many examples of how to use the DOM Selector in the tests directory.

// Assuming you installed from Composer:
require "vendor/autoload.php";

use DOMSelector\DOMSelector;

$yaml_string = '
title:
    css: "h1"
    type: Text
link:
    css: "h2 a"
    type: Link';

$selector = DOMSelector::fromYamlString($yaml_string);
$extracted = $selector->extract('<h1>Title</h1><h2>Usage <a class="headerlink" href="https://example.com">¶</a></h2>');

print_r($extracted);
// output

Array
(
    [title] => Title
    [link] => https://example.com
)

We strongly inspired by selectorlib written with python.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固