Symfony Crawler

Code
<?php

use Symfony\Component\DomCrawler\Crawler;

$file __DIR__ '/templates/site.html';

$dom = new DOMDocument();
$dom->loadHTMLFile($file);

$crawler = new Crawler($dom);

$h1 $crawler->filter('h1:first-child');
echo 
$h1->text();
Result
PHPSnippets
Used Versions
PHP 8.0, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8