<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
use Symfony\Component\DomCrawler\Crawler;
$client = new Client();
$response = $client->request('GET','https://www.alura.com.br/cursos-online-programacao/php');
$html = $response->getBody();
$crawler = new Crawler();
$crawler -> addHtmlContent($html);
$cursos = $crawler->filter('span class="card-curso__nome"');
foreach ($cursos as $curso){
echo $curso->textContent.PHP_EOL;
}
> php buscador.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\Emersow\Desktop\PHP\composer\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:201
Stack trace:
#0 C:\Users\Emersow\Desktop\PHP\composer\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection()
#1 C:\Users\Emersow\Desktop\PHP\composer\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError()
#2 C:\Users\Emersow\Desktop\PHP\composer\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish()
#3 C:\Users\Emersow\Desktop\PHP\composer\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke()
#4 C:\Users\Emersow\Desktop\PHP\composer\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}()
#5 C:\U in C:\Users\Emersow\Desktop\PHP\composer\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 201