FriendsOfPHP / Goutte

Goutte, a simple PHP Web Scraper
MIT License
9.26k stars 1.01k forks source link

Class 'Goutte\Client' not found #443

Open theresiaSLV opened 3 years ago

theresiaSLV commented 3 years ago

public function handle() { $Client = new Client();
$scrawler = $client->request('GET', 'https://www.symfony.com/blog/'); $crawler->filter('h2 > a')->each(function ($node) { print $node->text()."\n"; }); }

Symfony\Component\Debug\Exception\FatalThrowableError : Class 'Goutte\Client' not found

fabdelgado commented 3 years ago

Hi, have you added "use" before instance of class?

use Goutte\Client;