Pessoal, bom dia.
Estou realizando o curso de Composer com o grande mestre Vinicius Dias, especificamente na Aula 3, fiz toda a configuração igual no vídeo seguindo passo a passo, mas posso ter deixado passar algo... Eu tento executar o Guzzle para realizar a chamada no site da Alura, a fim de mostrar os cursos de PHP, com o seguinte código:
require 'vendor/autoload.php'; //composer ja traz o autoload, dentro de vendor
use Alura\BuscadorDeCursos\Buscador;
use GuzzleHttp\Client;
use Symfony\Component\DomCrawler\Crawler;
$client = new Client(['base uri' => "https://www.alura.com.br/"]);
$crawler = new Crawler();
$buscador = new Buscador($client, $crawler);
$cursos = $buscador->buscar("/cursos-online-programacao/php");
foreach ($cursos as $curso)
{
echo $curso.PHP_EOL;
};
Mas ele me retorna no prompt o seguinte erro:
PHP Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 3: (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in /Users/cassiolm/Desktop/1250-Composer/buscador-cursos-alura/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201
Stack trace:
#0 /Users/cassiolm/Desktop/1250-Composer/buscador-cursos-alura/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 /Users/cassiolm/Desktop/1250-Composer/buscador-cursos-alura/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 /Users/cassiolm/Desktop/1250-Composer/buscador-cursos-alura/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlF in /Users/cassiolm/Desktop/1250-Composer/buscador-cursos-alura/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 201
Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 3: (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in /Users/cassiolm/Desktop/1250-Composer/buscador-cursos-alura/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201
Stack trace:
#0 /Users/cassiolm/Desktop/1250-Composer/buscador-cursos-alura/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 /Users/cassiolm/Desktop/1250-Composer/buscador-cursos-alura/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 /Users/cassiolm/Desktop/1250-Composer/buscador-cursos-alura/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlF in /Users/cassiolm/Desktop/1250-Composer/buscador-cursos-alura/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 201
Conseguem me ajudar por gentileza? Obrigado!