How to get (scrap) value of unique element by ID from external website using php?

How to get (scrap) value of unique element by ID from external website using php?

 

$url = 'https://seatemperature.ru/current/abkhazia/gagra-sea-temperature';

$content = file_get_contents($url);

 

 

$dom = new DomDocument();

@ $dom->loadHTML($content,LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);

$element = $dom->getElementById('temp1'); //DOMElement

print_r($element->nodeValue); 

or

//$dom->saveHTML($element));

Метаданные статьи

Идентификатор статьи:
51
Категория:
Дата добавления:
08.06.2021 01:17:20
Просмотры:
217
Рейтинг (Голоса):
(1)