htmlxpath / htmlxpath
Simple HTML parsing with XPATH
v0.0.1
2017-03-28 01:14 UTC
Requires
- php: ^5.3.3 || ^7.0
This package is not auto-updated.
Last update: 2024-09-06 19:33:39 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;