feat: implement map view for lake visualization and automate data scraping pipeline
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import axios from 'axios';
|
||||
import * as cheerio from 'cheerio';
|
||||
import https from 'https';
|
||||
|
||||
async function test() {
|
||||
const agent = new https.Agent({ rejectUnauthorized: false });
|
||||
try {
|
||||
const res = await axios.get('https://www.pvl.cz/portal/nadrze/cz/pc/Nadrze.aspx', {
|
||||
httpsAgent: agent,
|
||||
headers: {
|
||||
'User-Agent': 'Mozilla/5.0'
|
||||
}
|
||||
});
|
||||
|
||||
const $ = cheerio.load(res.data);
|
||||
const rows = $('table tr');
|
||||
rows.each((i, row) => {
|
||||
console.log($(row).text().replace(/\s+/g, ' '));
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
}
|
||||
test();
|
||||
Reference in New Issue
Block a user