Answer the question
In order to leave comments, you need to log in
Why does Class 'GuzzleHttp\Client' not found when loading a project through Composer?
I ran this command in the project:
composer require raiym/instagram-php-scraper
Everything loaded: I
created a separate index.php file, into which I inserted the code from the example of this library:
use Phpfastcache\Helper\Psr16Adapter;
require __DIR__ . '/vendor/autoload.php';
$instagram = new \InstagramScraper\Instagram(new \GuzzleHttp\Client());
$media = $instagram->getMediaByUrl('https://www.instagram.com/p/BHaRdodBouH');
echo "Media info:\n";
echo "Id: {$media->getId()}\n";
echo "Shortcode: {$media->getShortCode()}\n";
echo "Created at: {$media->getCreatedTime()}\n";
echo "Caption: {$media->getCaption()}\n";
echo "Number of comments: {$media->getCommentsCount()}";
echo "Number of likes: {$media->getLikesCount()}";
echo "Get link: {$media->getLink()}";
echo "High resolution image: {$media->getImageHighResolutionUrl()}";
echo "Media type (video or image): {$media->getType()}";
$account = $media->getOwner();
echo "Account info:\n";
echo "Id: {$account->getId()}\n";
echo "Username: {$account->getUsername()}\n";
echo "Full name: {$account->getFullName()}\n";
echo "Profile pic url: {$account->getProfilePicUrl()}\n";
Fatal error: Uncaught Error: Class 'GuzzleHttp\Client' not found in /Users/picka/Desktop/instagram-php-scraper-master/index.php on line 11</b>
Error: Class 'GuzzleHttp\Client' not found in /Users/picka/Desktop/instagram-php-scraper-master/index.php on line 11
Answer the question
In order to leave comments, you need to log in
When you create a new scrapper instance
$instagram = new \InstagramScraper\Instagram(new \GuzzleHttp\Client());
composer require guzzlehttp/guzzle
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question