<?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);
$courses = $crawler->filter('span.card-curso__carga');
$sumHours = 0;
foreach ($courses as $courses) {
$sumHours += intval($curso->textContent);
}
echo $sumHours;