htmlxpath/htmlxpath

Simple HTML parsing with XPATH

v0.0.1 2017-03-28 01:14 UTC

This package is not auto-updated.

Last update: 2024-05-03 17:48:46 UTC


README

HTMLXPath is a small utility for consuming HTML web pages and querying using XPath.

Install

composer require htmlxpath/htmlxpath

Usage

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

foreach(HTMLXPath\xpath('http://www.seanbehan.com', '//a/text()') as $node)
  echo $node->nodeValue;

// or...
foreach(HTMLXPath\html(file_get_contents('http://seanbehan.com')) as $doc)
  foreach(HTMLXPath\query($doc, '//a/text()') as $node)
    echo $node->nodeValue;