2017 © Pedro Peláez
 

library htmldomparser

PHP HTML DOM Parser

image

jorgecasas/htmldomparser

PHP HTML DOM Parser

  • Friday, April 25, 2014
  • by jorgecasas
  • Repository
  • 2 Watchers
  • 2 Stars
  • 165 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

HTML DOM Parser

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version., (*1)

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details., (*2)

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/., (*3)

  • More info: ITERNOVA [http://www.iternova.net]
  • Based on: http://sourceforge.net/projects/simplehtmldom

Example

Usage Example:
// Create a DOM object
$dom = new HTMLDOMParser\DOM();

// Load HTML from a string
$dom->load('

Hello World!
'); // Find an element $element = $dom->find( 'div' ); // Modify elements foreach( $dom->find( '.foo' ) as $element ) { $element->innertext = 'Hi World!'; } // Also... modify first div element style... $dom->find( 'div', 0 )->style = 'border:1px solid #CCCCCC;'; // Or CSS classes... modify first div element... $dom->find( 'div[id=hello_div]', 0 )->class = 'bar'; // Or content! $dom->find( 'div', 0)->innertext = 'Hi again!'; // Return HTML from DOM tree $str_html = $dom->get_html();

Composer.json

In order to use composer, complete your composer.json file with:, (*4)

{
    "require": {
       "jorgecasas/htmldomparser": "dev-master"
    }
}

The Versions

25/04 2014

dev-master

9999999-dev https://github.com/jorgecasas/htmldomparser

PHP HTML DOM Parser

  Sources   Download

GPLv3

The Requires

  • php >=5.3.0

 

parser php html dom