2017 © Pedro Peláez
 

library parse-html

ParseHTML is PHP library working like jQuery, give you an easy way to get any information from text html.

image

ijortengab/parse-html

ParseHTML is PHP library working like jQuery, give you an easy way to get any information from text html.

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 8 Versions
  • 5 % Grown

The README.md

parseHTML

parseHTML is PHP library working like jQuery, give you an easy way to get any information from text html., (*1)

Requirement

PHP 5.4, (*2)

Usage

If you familiar with jQuery, you'll be smile., (*3)

jQuery parseHTML
document $contents = file_get_contents('~/my.html');
$html = $(document); $html = new parseHTML($contents);
var title = $html.find('title').text(); $title = $html->find('title')->text();
var url = $html.find('a.links').attr('href'); $url = $html->find('a.links')->attr('href');

Method Support

Method Description
::find() http://api.jquery.com/find/
::html() http://api.jquery.com/html/
::text() http://api.jquery.com/text/
::attr() http://api.jquery.com/attr/
::eq() http://api.jquery.com/eq/
::getElementById() https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById
::getElementByClass() https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
::getElementByTag() https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName
::getElementByAttribute() https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute

Selector Support

You can find more description by visit this link http://api.jquery.com/category/selectors/, (*4)

Selector Example
ID selector #my-table-1
Class Selector .links'
Element Selector element
Descendant Selector ancestor descendant
Child Selector parent > child
Attribute [name]
Attribute Contains Prefix Selector [name|='value']
Attribute Contains Selector [name*='value']
Attribute Contains Word Selector [name~='value']
Attribute Ends With Selector [name$='value']
Attribute Equals Selector [name='value']
Attribute Not Equal Selector [name!='value']
Attribute Starts With Selector [name^='value']

Of course, you can mix all selector above, example: - #form-register.front input - a.links[ref='nofollow'] - div.office > span.address, (*5)

and, you can get multiple selector, example: - 'input, textarea, select, button', (*6)

Simlilar Project

PHP Simple HTML DOM Parser, (*7)

The Versions

07/02 2016

dev-master

9999999-dev

ParseHTML is PHP library working like jQuery, give you an easy way to get any information from text html.

  Sources   Download

GPL

The Requires

  • php >=5.4.0

 

16/01 2016

v0.0.7

0.0.7.0

parseHTML is PHP library working like jQuery, give you an easy way to get any information from text html.

  Sources   Download

GPL

The Requires

  • php >=5.4.0

 

22/12 2015

v0.0.6

0.0.6.0

parseHTML is PHP library working like jQuery, give you an easy way to get any information from text html.

  Sources   Download

GPL

The Requires

  • php >=5.4.0

 

13/12 2015

v0.0.5

0.0.5.0

parseHTML is PHP library working like jQuery, give you an easy way to get any information from text html.

  Sources   Download

GPL

The Requires

  • php >=5.4.0

 

18/11 2015

v0.0.4

0.0.4.0

parseHTML is PHP library working like jQuery, give you an easy way to get any information from text html.

  Sources   Download

GPL

17/11 2015

v0.0.3

0.0.3.0

parseHTML is PHP library working like jQuery, give you an easy way to get any information from text html.

  Sources   Download

GPL

17/11 2015

v0.0.2

0.0.2.0

parseHTML is PHP library working like jQuery, give you an easy way to get any information from text html.

  Sources   Download

GPL

17/11 2015

v0.0.1

0.0.1.0

parseHTML is PHP library working like jQuery, give you an easy way to get any information from text html.

  Sources   Download

GPL