$result = file_get_contents("http://pogoda.ee"); preg_match( '/<td id="L_R_tl".?(.*?)<\/td>/is', $result , $links ); print_r($links); 

the site has text in the tag and in file get contents there is no
how to make it so it would not be empty in the tag

    1 answer 1

    On that site, the content is tagged with jQuery after the page loads. In php, this can not be done. Try using either another site or api.

    • @NoProgress as already mentioned in the response, the content gets to the page via AJAX . But AJAX then in between times gets data from a known URL, so you generally don’t even need to write a parser. You can just get JSON ready and work with it. - teran
    • f12 shows that 3 ajax requests are executed. Understand where that, and all the cases. - teran
    • Does this in the case of cross-domain queries work? - Rochfort
    • Cross-domain requests cause a problem when the request is executed by ajax itself, the author performs it using php, so there will not be any restrictions here. - teran
    • hmm, maybe you are right, but bother so much for parsing html? I would try some api instead of curl + json + regexp - Rochfort