2017 © Pedro Peláez
 

library html_parser

HTML parser

image

pmvc-plugin/html_parser

HTML parser

  • Sunday, April 22, 2018
  • by HillLiu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 263 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 5 % Grown

The README.md

Latest Stable Version Latest Unstable Version Build Status License Total Downloads, (*1)

Html Parser

How to use?

public function css($content, $selector), (*2)

include('vendor/autoload.php');
PMVC\Load::plug();
$plug = \PMVC\plug('html_parser');
$object = $plug->css($html, $your_css_$selector);
var_dump($object->html());

Useful tip

text or html

  • object->text()
  • object->html()

get tag attribute

  • object->attr('href')

Process a list (QueryPath)

  • https://web.archive.org/web/20120504094800/http://api.querypath.org/docs/class_query_path.html
  • Get one index
   $DOMElement = QueryPath->get(int index)                  // start from zero
   \PMVC\plug('html_parser')->css($DOMElement, $selector);

Parse Engine

  • Old Api(better):
    • https://web.archive.org/web/20130123082558/http://api.querypath.org/docs/
  • https://github.com/technosophos/querypath

Install with Composer

1. Download composer

  • mkdir test_folder
  • curl -sS https://getcomposer.org/installer | php

2. Install Use composer.json or use command-line directly

2.1 Install Use composer.json

  • vim composer.json
{
    "require": {
        "pmvc-plugin/html_parser": "dev-master"
    }
}
  • php composer.phar install

2.2 Or use composer command-line

  • php composer.phar require pmvc-plugin/html_parser, (*3)

    or, (*4)

  • composer require pmvc-plugin/html_parser

The Versions

22/04 2018

dev-master

9999999-dev

HTML parser

  Sources   Download

MIT

The Requires

 

by Hill

html parser plug-in pmvc

22/04 2018

0.1.11

0.1.11.0

HTML parser

  Sources   Download

MIT

The Requires

 

by Hill

html parser plug-in pmvc

21/02 2018

0.1.10

0.1.10.0

HTML parser

  Sources   Download

MIT

The Requires

 

by Hill

html parser plug-in pmvc

07/03 2017

0.1.9

0.1.9.0

HTML parser

  Sources   Download

MIT

The Requires

 

by Hill

html parser plug-in pmvc

07/03 2017

0.1.8

0.1.8.0

HTML parser

  Sources   Download

MIT

The Requires

 

by Hill

html parser plug-in pmvc