library htmlxpath
Simple HTML parsing with XPATH
htmlxpath/htmlxpath
Simple HTML parsing with XPATH
- Tuesday, March 28, 2017
- by seanbehan
- Repository
- 1 Watchers
- 0 Stars
- 9 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
About
HTMLXPath is a small utility for consuming HTML web pages and querying using XPath., (*1)
Install
composer require htmlxpath/htmlxpath
, (*2)
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;