I'd like to use WebParser to call in principle this page and collect/parse specific weather data (hourly UV-index and cloud cover):
https://14-tage-wettervorhersage.de/wetter/paris/stuendlich/623/
In the page source I found this section describing the fetchURL with the required parameters (here for Paris/France as an example):
Code: Select all
function loadNext(pagination) {
var fetchURL = '/get/get_hourly_next.php';
const params = new URLSearchParams();
params.append('cityid', '623');
params.append('city', 'paris');
params.append('tab', 'stuendlich');
if (pagination !== 0) {
params.append('s', pagination);
}
fetch(fetchURL, {
method: 'POST',
headers: {
'X-Requested-With': 'XMLHttpRequest',
'Content-Type': 'application/x-www-form-urlencoded',
},
body: params
})
.then(response => response.text())
.then(html => {
Code: Select all
function drawWolken() {
var dataTable = new google.visualization.DataTable();
dataTable.addColumn('string', 'Stunde');
dataTable.addColumn('number', 'Wolken');
// A column for custom tooltip content
dataTable.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': true}});
dataTable.addColumn('number', 'UV-Index');
// A column for custom tooltip content
dataTable.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': true}});
dataTable.addRows([
['Do. 22:00',57,'57 %',0,'0 (Niedrig)'],
['Do. 23:00',84,'84 %',0,'0 (Niedrig)'],
['Fr. 00:00',80,'80 %',0,'0 (Niedrig)'],
['Fr. 01:00',76,'76 %',0,'0 (Niedrig)'],
['Fr. 02:00',84,'84 %',0,'0 (Niedrig)'],
['Fr. 03:00',92,'92 %',0,'0 (Niedrig)'],
['Fr. 04:00',100,'100 %',0,'0 (Niedrig)'],
['Fr. 05:00',100,'100 %',0,'0 (Niedrig)'],
['Fr. 06:00',100,'100 %',0,'0 (Niedrig)'],
['Fr. 07:00',100,'100 %',0,'0 (Niedrig)'],
['Fr. 08:00',100,'100 %',0,'0 (Niedrig)'],
['Fr. 09:00',100,'100 %',0,'0 (Niedrig)'],
['Fr. 10:00',100,'100 %',1,'1 (Niedrig)'],
['Fr. 11:00',99,'99 %',1,'1 (Niedrig)'],
['Fr. 12:00',99,'99 %',1,'1 (Niedrig)'],
['Fr. 13:00',94,'94 %',1,'1 (Niedrig)'],
['Fr. 14:00',84,'84 %',1,'1 (Niedrig)'],
['Fr. 15:00',76,'76 %',2,'2 (Niedrig)'],
['Fr. 16:00',76,'76 %',1,'1 (Niedrig)'],
['Fr. 17:00',76,'76 %',1,'1 (Niedrig)'],
['Fr. 18:00',76,'76 %',0,'0 (Niedrig)'],
['Fr. 19:00',37,'37 %',0,'0 (Niedrig)'],
['Fr. 20:00',40,'40 %',0,'0 (Niedrig)'],
['Fr. 21:00',42,'42 %',0,'0 (Niedrig)'],
]);
Help is much appreciated... I'm not a specialist in php unfortunately...