yangqi/htmldom 问题修复 & 功能扩展

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

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

yangqi/htmldom

最新稳定版本:v1.0.0

Composer 安装命令:

composer require yangqi/htmldom

包简介

Simple Html Dom Parser for Laravel 4

README 文档

README

A Htmldom package for Laravel 4 and 5 based on Simple HTML Dom Parser

Installation

Add the following line to the require section of composer.json:

{
    "require": {
        "yangqi/htmldom": "1.0.*"
    }
}

Laravel 5 Setup (same as Laravel 4)

  1. Add the service provider to config/app.php.
'providers' => array(
    ...
	'Yangqi\Htmldom\HtmldomServiceProvider',
    ...
  1. Add alias to config/app.php.
'aliases' => array(	
    ...
	'Htmldom' => 'Yangqi\Htmldom\Htmldom',
    ...

Usage

  1. Use following:
$html = new \Htmldom('http://www.example.com');

// Find all images 
foreach($html->find('img') as $element) 
       echo $element->src . '<br>';

// Find all links 
foreach($html->find('a') as $element) 
       echo $element->href . '<br>';

See the detailed documentation http://simplehtmldom.sourceforge.net/manual.htm

统计信息

  • 总下载量: 680.18k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 94
  • 点击次数: 1
  • 依赖项目数: 13
  • 推荐数: 2

GitHub 信息

  • Stars: 92
  • Watchers: 6
  • Forks: 58
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-10-28