使用 php 或 javascript 从 html 表中检索(获取)当前天气数据


Retrieve (get) current weather data from html table with php or javascript

我想从其他站点的html表中获取当前天气数据。我想从中获取有关河流,流量和其他信息的当前(每小时刷新一次)信息的网页:http://www.arso.gov.si/vode/podatki/stanje_voda_samodejne.html。

问题是我如何检索所有列的数据(有关河流的数据),而不是所有行(河流)的数据,例如河流穆拉、德拉瓦、索拉。

我想在我的网站上的表格上显示带有 php 或 javascript 的数据。请帮忙!

从 url 获取数据

这将为您提供给定页面的html。

$content = file_get_contents('you url here');
$this->html =  $content;
$this->process();
function process(){
// Your html extraction code here
}

注意

Webscrping用于从网站上删除公共数据。这取决于网站的政策。

https://www.quora.com/What-is-the-legality-of-web-scraping