Bramus\MCS\DOMDocument::extractLinks PHP Method

    public function extractLinks()
    {
        $links = [];
        // Loop all links and extract their href value
        foreach ($this->getElementsByTagName('a') as $el) {
            if ($el->hasAttribute('href')) {
                $links[] = $el->getAttribute('href');
            }
        }
        return $links;
    }