Quick Help

Knowledgebase is a categorized collection of answers to frequently asked questions (FAQ) and articles. You can read articles in this category or select a subcategory that you are interested in.



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

Solution

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));

 
Was this article helpful? yes / no

Article details

Article ID: 51

Category: Web development

Date added: 2021-06-08 01:17:20

Views : 62

Rating (Votes): Article rated 5.0/5.0 (1)

 
Powered by Help Desk Software HESK, in partnership with SysAid Technologies