collab / module-scraper
Simple wrapper for the phpscraper library which provides Magento Service for scraping web pages.
Installs: 241
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:magento2-module
Requires
- magento/framework: *
- spekulatius/phpscraper: *
README
The Collab_Scraper module is a simple wrapper for PHPScraper which provides service for scraping data from websites.
PHPScraper is a versatile web-utility for PHP. Its primary objective is to streamline the process of extracting information from websites, allowing you to focus on accomplishing tasks without getting caught up in the complexities of selectors, data structure preparation, and conversion.
Basic usage
use Collab\Scraper\Service\ScraperService; ... public function __construct( ScraperService $scraperService ) { $this->scraperService = $scraperService; } ... public function getScrapedData(): ?string { $url = 'https://www.example.com'; $data = $this->scraperService->go($url); echo $data->title; // Title of the page return $data; }
Full documentation for PHPScraper can be found here.
Installation details
composer require collab/module-scraper bin/magento setup:upgrade