2017 © Pedro Peláez
 

library php-html-dom-parser

Composer adaptation and wrapper for the Simple HTML DOM parser written on PHP5+ let you manipulate HTML in a very easy and fast way. It supports invalid HTML DOM and may find tags in HTML DOM with selectors just like jQuery.

image

asymptix/php-html-dom-parser

Composer adaptation and wrapper for the Simple HTML DOM parser written on PHP5+ let you manipulate HTML in a very easy and fast way. It supports invalid HTML DOM and may find tags in HTML DOM with selectors just like jQuery.

  • Tuesday, July 21, 2015
  • by dzarezenko
  • Repository
  • 1 Watchers
  • 2 Stars
  • 563 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

Asymptix PHP HTML DOM Parser

Composer adaptation and wrapper for the Simple HTML DOM parser written on PHP5+ let you manipulate HTML in a very easy and fast way. It supports invalid HTML DOM and may find tags in HTML DOM with selectors just like jQuery., (*1)

Composer installation

To install with Composer simply create this composer.json file in your project root folder and run composer command composer install., (*2)

{
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.3.2",
        "asymptix/php-html-dom-parser": "1.5.*"
    }
}

Usage

Here you can find a simple example how to use Parser to parse products from some shop web-site and then parse product details from product pages:, (*3)

use Asymptix\HtmlDomParser\HtmlDomParser;

require_once('vendor/autoload.php');

$url = "http://www.some-shop.com/";
$html = new HtmlDomParser();
$html->loadUrl($url);
foreach ($html->find("a.product") as $productItem) {
    $productHtml = new HtmlDomParser();
    $productHtml->loadUrl($productItem->href);

    $productDetails = $productHtml->find("div#productDetails", 0);
    $productForm = $productHtml->find("div#productForm", 0);

    $product = new stdClass();

    if (is_object($productForm)) {
        $product->price = $productForm->find("div.price", 0)->plaintext;
    }

    unset($productHtml);
}

Copyright (c) 2012 S.C. Chen, John Schlick, Rus Carroll from the Simple HTML DOM lib developers team., (*4)

Copyright (c) 2015 Asymptix., (*5)

The Versions

21/07 2015

dev-master

9999999-dev

Composer adaptation and wrapper for the Simple HTML DOM parser written on PHP5+ let you manipulate HTML in a very easy and fast way. It supports invalid HTML DOM and may find tags in HTML DOM with selectors just like jQuery.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

parser php html dom asymptix

21/07 2015

1.5.x-dev

1.5.9999999.9999999-dev

Composer adaptation and wrapper for the Simple HTML DOM parser written on PHP5+ let you manipulate HTML in a very easy and fast way. It supports invalid HTML DOM and may find tags in HTML DOM with selectors just like jQuery.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

parser php html dom asymptix

21/07 2015

v1.5.1

1.5.1.0

Composer adaptation and wrapper for the Simple HTML DOM parser written on PHP5+ let you manipulate HTML in a very easy and fast way. It supports invalid HTML DOM and may find tags in HTML DOM with selectors just like jQuery.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

parser php html dom asymptix