DOMDocument loadHTML只返回一个div

时间:2017-07-16 16:33:09

标签: php parsing dom domdocument

我正在尝试从页面解析HTML,并从中访问特定节点。我试过这段代码:

$result = file_get_contents("http://zvg-portal.de/index.php?button=Suchen&all=1", false, $context);
$dom = new DOMDocument;
$html = $dom->loadHTML($result);

问题是它只返回一个带有字符串的div,但是我需要将节点作为对象。

由于HTML不好,我也收到很多警告。

0 个答案:

没有答案