smartango / verygrabber
generic grabber based on DOMDocument, grabbing infos from an html page
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:HTML
Requires (Dev)
- phpunit/php-invoker: 6.0.0
- phpunit/phpunit: 12.1.5
This package is auto-updated.
Last update: 2025-06-12 06:04:34 UTC
README
smartango/verygrabber scrape html following a json schema definition.
It is designed to grab an array of elements, such as table rows or list of DIVs.
Usage
use \smrtg\VeryGrabber\GrabFromSchema; $doc = file_get_contents(dirname(__FILE__).'/data/file.html'); $grab = new GrabFromSchema($doc); $schema = file_get_contents(dirname(__FILE__).'/data/schema.json'); $data = $grab->getStruct($schema);
See tests/data/schema.json for the json schema definition: it follows a recursive descending parser concept in the DOM