aashan10 / scrapeio
There is no license information available for the latest version (dev-main) of this package.
A tool for your daily web scraping.
dev-main
2022-06-01 18:45 UTC
Requires
- ext-dom: *
- ext-libxml: *
- guzzlehttp/guzzle: ^7.4
- illuminate/collections: ^9.15
Requires (Dev)
- phpunit/phpunit: ^9.5
- symfony/var-dumper: ^6.1
This package is auto-updated.
Last update: 2024-10-29 06:30:51 UTC
README
This library aims to simplify crawling the web for results.
Installation
composer require aashan10/scrapeio
Usage
The scraping API is provided by Scrapeio\Scrapper
class and can be used in a pattern below.
<?php ... require_once 'vendor/autoload.php'; ... $scrapeio = new \Scrapeio\Scraper('GET', 'https://www.php.net/manual/en/function.preg-match.php'); $collection = $scrapeio ->setQuery('//div[@id="function.preg-match"]//p[@class="refpurpose"]') ->scrape(); echo ($collection->first()->escapeHtmlAndGetData()); echo "<br />"; $collection = $scrapeio->setQuery('//section[@id="usernotes"]//div[@id="allnotes"]//div//strong[@class="user"]//em')->scrape(); echo $collection->count() . ' users contributed to this documentation in php.net!';```