1. Go to this page and download the library: Download mkocztorz/data-scraper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mkocztorz / data-scraper example snippets
use Mkocztorz\DataScraper\Std\Extractor;
$extractor = new Extractor();
$data = $extractor->extract($crawler); //step 2 - the actual scraping
$extractor->getList('ul li', [
'name' => $extractor->getText('h1'), // actually selecting: "ul li h1"
'age' => $extractor->getText('p'), // actually selecting: "ul li p"
'id' => $extractor->getAttribute('', ['attr'=>'id']), // actually selecting "ul li", assuming that each li will have id attribute
]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.