我正在尝试运行以下脚本:
<?php
use Goutte\Client;
$client = new Client();
$crawler = $client->request('GET', 'https://www.symfony.com/blog/');
print($crawler);
我的composer.json
文件如下所示:
{
"require": {
"fabpot/goutte": "^3.2"
}
}
但是,我收到以下错误:
Fatal error: Uncaught Error: Class 'Goutte\Client' not found in /home/ubuntu/workspace/src/t01-makeRequests.php:5
Stack trace:
#0 {main}
thrown in /home/ubuntu/workspace/src/t01-makeRequests.php on line 5
有关如何在我的脚本中正确加载库的任何建议吗?
感谢您的回复!