O meu código está assim:
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client; use Symfony\Component\DomCrawler\Crawler;
$client = new Client(); $resposta = $client->request('GET', 'https://cursos.alura.com.br/category/programacao#php');
$html = $resposta->getBody();
$crawler = new Crawler(); $crawler->addhtmlContent($html);
$cursos = $crawler->filter('span.card-curso__nome');
foreach ($cursos as $curso) { $curso->textContent . PHP_EOL; }
E ele me retorna esse erro.
PHP Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in C:\Users\rodri\eclipse-workspace\buscador-cursos-alura\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:201 Stack trace:
#0 C:\Users\rodri\eclipse-workspace\buscador-cursos-alura\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection()#1 C:\Users\rodri\eclipse-workspace\buscador-cursos-alura\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError()
#2 C:\Users\rodri\eclipse-workspace\buscador-cursos-alura\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish()
#3 C:\Users\rodri\eclipse-workspace\buscador-cursos-alura\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke()
#4 C:\Users\rodri\eclipse-workspace\buscador-cursos-alura\vendor\guzzleh in C:\Users\rodri\eclipse-workspace\buscador-cursos-alura\vendor\guzzlehttp\guzzle\src\HandlePS C:\Users\rodri\eclipse-workspace\buscador-cursos-alura> php buscar-cursos.php PHP Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in C:\Users\rodri\eclipse-workspace\buscador-cursos-alura\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:201 Stack trace:
#0 C:\Users\rodri\eclipse-workspace\buscador-cursos-alura\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection()#1 C:\Users\rodri\eclipse-workspace\buscador-cursos-alura\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError()
#3 C:\Users\rodri\eclipse-workspace\buscador-cursos-alura\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke()
#4 C:\Users\rodri\eclipse-workspace\buscador-cursos-alura\vendor\guzzleh in C:\Users\rodri\eclipse-workspace\buscador-cursos-alura\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 201
Como corrigir?