php xpath 中的错,下面代码

 $dom = new DOMDocument();
    @$dom->loadHTML($html);
    $xpath = new DOMXPath($dom);
        $keywords = $xpath->evaluate("/html/head/meta[@name='keywords']");
    $content1 = $keywords->getAttribute('content');

报错的地方就在代码的最后一行
Fatal error: Uncaught Error: Call to undefined method DOMNodeList::getAttribute() in