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 7.2, Zend 3.0, Symfony 4.0, Laravel 5.6, PHPUnit 6.5, Doctrine 2.8