1. Go to this page and download the library: Download sleimanx2/grawler 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/ */
sleimanx2 / grawler example snippets
$client = new Bowtie\Grawler\Client();
$grawler = $client->download('http://example.com');
$grawler->title();
// provide a css path to find the attribute
$grawler->body($path = '.main-content');
// extracts meta keywords (array)
$grawler->keywords();
// extracts meta description
$grawler->description();
$grawler->images('.content img');
$grawler->videos('iframe');
$grawler->audio('.audio iframe');
// resolve all videos at once
$videos = $grawler->videos('iframe')->resolve();
foreach($videos as $video)
{
$video->id; // the video provider id
$video->title;
$video->description;
$video->url;
$video->embedUrl;
$video->images; // Collection of Image instances
$video->author;
$video->authorId;
$video->duration;
$video->provider; //video source
}