ityler Posted November 29, 2012 Share Posted November 29, 2012 Howdy, I just started experimenting with Goutte - found here on Github: https://github.com/f...ore-information I followed the examples almost exactly but here is my code anyways: <?php require_once 'goutte.phar'; use Goutte\Client; $client = new Client(); $crawler = $client->request('GET','http://www.cnn.com/'); $nodes = $crawler->filter('.error_list'); if ($nodes->count()) { // die(sprintf("Authentication error: %s\n", $nodes->text())); } // This part of the code I havent even changed yet being I can't get passed this problem :/ printf("Nb tasks: %d\n", $crawler->filter('nb_tasks')->text()); ?> Here is what is displayed on the page when running the php code: ????????G?? Fatal error: Class 'Goutte\Client' not found in /Applications/XAMPP/xamppfiles/htdocs/scrape.php on line 7. I have used PHP in the past but im a bit rusty, my apologies if it is something simple. I checked the Github issues and their doesn't appear to be any issues related to the problem I am currently having. I have the goutte.phar file in the same directory as the file with the code above so I am unsure why the fatal error is occurring on not finding the Client class? Thanks for the help! Quote Link to comment https://forums.phpfreaks.com/topic/271322-help-with-goutte-php-web-scraping/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.