2017 © Pedro Peláez
 

library extractor

HTML Parser

image

fizzka/extractor

HTML Parser

  • Wednesday, July 19, 2017
  • by fizzka
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2,362 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 8 Versions
  • 20 % Grown

The README.md

extractor

html extraction library, based on SimpleXML & nokogiri XpathSubquery.php, (*1)

Latest Stable Version Build Status Coveralls, (*2)

Benefits

  • Simple
  • Minimal code
  • Fast
  • Query results are SimpleXMLElement instances
  • Supports nested css/xpath queries

Installation

#Using packagist:
composer require 'fizzka/extractor'

Basic Usage

<?php
require_once 'vendor/autoload.php';

$html = gzdecode(file_get_contents('http://habrahabr.ru/'));

$ex = Extractor::fromHtml($html);
var_dump($ex->get('a.habracut'));

Advanced Usage

echo $ex->cssPathFirst('div.post')->xpathFirst('.//@href');

foreach ($ex->cssPath('div.post') as $post) {
    var_dump($post->cssPathFirst('a.post_title'));
}

Testing

Just run phpunit from the top of project, (*3)

Contribute

Feel free to use & contribute ;), (*4)

License

MIT, (*5)

The Versions

19/07 2017

dev-test-go

dev-test-go

HTML Parser

  Sources   Download

MIT

The Requires

  • php >=5.2

 

The Development Requires

by Avatar fizzka

parser html extractor parse

26/06 2017

dev-master

9999999-dev

HTML Parser

  Sources   Download

MIT

The Requires

  • php >=5.2

 

The Development Requires

by Avatar fizzka

parser html extractor parse

25/06 2017

0.3.3

0.3.3.0

HTML Parser

  Sources   Download

MIT

The Requires

  • php >=5.2

 

The Development Requires

by Avatar fizzka

parser html extractor parse

02/08 2016

0.3.2

0.3.2.0

HTML Parser

  Sources   Download

MIT

The Requires

  • php >=5.2

 

by Avatar fizzka

parser html extractor parse

07/09 2015

0.3.1

0.3.1.0

HTML Parser

  Sources   Download

MIT

The Requires

  • php >=5.2

 

by Avatar fizzka

parser html extractor parse

16/06 2015

0.3

0.3.0.0

HTML Parser

  Sources   Download

MIT

The Requires

  • php >=5.2

 

by Avatar fizzka

parser html extractor parse

06/06 2015

0.2

0.2.0.0

HTML Parser

  Sources   Download

MIT

The Requires

  • php >=5.2

 

by Avatar fizzka

parser html extractor parse

06/06 2015

0.1

0.1.0.0

HTML Parser

  Sources   Download

MIT

The Requires

  • php >=5.2

 

by Avatar fizzka

parser html extractor parse