PHP code example of refactors / smart-scraper

1. Go to this page and download the library: Download refactors/smart-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/ */

    

refactors / smart-scraper example snippets


$scraper = new SmartScraper\Parser($theUrlYouWantToScrape);

$scraper->saveText($name, $expression, [$attribute = null]);

$scraper->saveText( 'nick', '.header h1' );
echo $scraper->nick;

$scraper->saveHtml($name, $expression, [$index = 0]);
$scraper->{$name}