Hello! I installed via composer (composer require raiym/instagram-php-scraper) and apparently all installed correctly, no errors were shown. But when I try a test like:
`
error_reporting(E_ALL);
ini_set('display_errors', '1');
require_once 'vendor/autoload.php';
use InstagramScraper\Instagram;
use InstagramScraper\Model\Media;
Hello! I installed via composer (composer require raiym/instagram-php-scraper) and apparently all installed correctly, no errors were shown. But when I try a test like:
` error_reporting(E_ALL); ini_set('display_errors', '1'); require_once 'vendor/autoload.php'; use InstagramScraper\Instagram; use InstagramScraper\Model\Media;
$instagram = Instagram::withCredentials('myuser', 'mypass'); $instagram ->login();
$posts = $instagram->getTopMediasByTagName('smsda');
print_r($posts);
foreach ($posts as $i => $post) { echo ($i) . '. ' . $post->caption . PHP_EOL; } `
I get "Fatal error: Cannot access protected property InstagramScraper\Model\Media::$caption in ... test.php"
the print_r shows me
Array ( [0] => InstagramScraper\Model\Media Object ( [id:protected] => 1633578741186982284 [shortCode:protected] => BarozXFFHGM [createdTime:protected] => 1508957782 [type:protected] => image [link:protected] => ...
what am I doing wrong?
Thx so much in advance!