feat: update lake index, sync scraping scripts, and prune unused data files
This commit is contained in:
+8
-4
@@ -5,7 +5,7 @@ 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', {
|
||||
const res = await axios.get('https://www.pvl.cz/portal/nadrze/cz/pc/Mereni.aspx?oid=1&id=VLL1', {
|
||||
httpsAgent: agent,
|
||||
headers: {
|
||||
'User-Agent': 'Mozilla/5.0'
|
||||
@@ -13,10 +13,14 @@ async function test() {
|
||||
});
|
||||
|
||||
const $ = cheerio.load(res.data);
|
||||
const rows = $('table tr');
|
||||
rows.each((i, row) => {
|
||||
console.log($(row).text().replace(/\s+/g, ' '));
|
||||
const tables = $('table');
|
||||
tables.each((i, tbl) => {
|
||||
console.log(`TABLE ${i}:`);
|
||||
console.log($(tbl).find('tr').first().text().trim().replace(/\s+/g, ' '));
|
||||
console.log($(tbl).find('tr').eq(1).text().trim().replace(/\s+/g, ' '));
|
||||
console.log('---');
|
||||
});
|
||||
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user