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.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6