public static function getLinks(\DOMDocument $html, $tagName = 'link')
    {
        $links = [];

        foreach ($html->getElementsByTagName($tagName) as $link) {
            if ($link->hasAttribute('rel') && $link->hasAttribute('href')) {
                $rel = trim(strtolower($link->getAttribute('rel')));
                $href = $link->getAttribute('href');

                $links[] = [$rel, $href, $link];
            }
        }

        return $links;
    }