我正在尝试从以下URL解析以下HTML代码:
http://md5.rednoize.com/?q=fbade9e36a3f36d3d676c1b808451dd7
代码如下:
有没有办法仍然能够解析它?
$html = file_get_contents($url.$hash);
$config = array(
'clean' => 'yes',
'output-html' => 'yes',
);
$tidy = tidy_parse_string($html, $config, 'utf8');
$tidy->cleanRepair();
$dom = new DOMDocument;
$dom->loadHTML($tidy);
$result = $dom->getElementById('result');
然而,它是无效的:
Warning: DOMDocument::loadHTML() [<a href='domdocument.loadhtml'>domdocument.loadhtml</a>]: ID switcher already defined in Entity, line: 128 in
有没有办法仍然能够解析它?
$dom->loadHTML($tidy);
更改为$dom->loadHTML($tidy->value);
会发生什么? - Glass Robot