我在这个 php xpath 应用程序中遇到错误,我无法修复,如果可能的话,我希望能得到一些帮助
<?php
//Get Username
$username = $_GET["u"];
$html = file_get_contents('http://us.playstation.com/publictrophy/index.htm?onlinename=' .$username);
$html = tidy_repair_string($html);
$doc = new DomDocument();
$doc->loadHtml($html);
$xpath = new DomXPath($doc);
// Now query the document:
foreach ($xpath->query('//*[@id="id-handle"]') as $node) {
echo $node, "\n";
}
foreach ($xpath->query('//*[@id="leveltext"]') as $node1) {
echo $node1, "\n";
}
?>