Я хочу очистить раздел последних новостей PSNC News
Код: Выделить всё
$ch = curl_init("http://psnc.org.uk/our-latest-news-category/psnc-news/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
$document = new DOMDocument;
libxml_use_internal_errors(true);
$document->loadHTML($output);
$xpath = new DOMXPath($document);
$tweets = $xpath->query("//article[@class='news-template-box']");
echo "";
foreach ($tweets as $tweet) {
echo "\n
".$tweet->nodeValue."\n";
}
echo "";
Я Я что-то пропустил?
Подробнее здесь: https://stackoverflow.com/questions/414 ... ot-working