Files
tenderpilot/test-etenders.js

22 lines
568 B
JavaScript
Raw Permalink Normal View History

import axios from 'axios';
import * as cheerio from 'cheerio';
const url = 'https://etendersni.gov.uk/epps/home.do';
try {
const resp = await axios.get(url, { timeout: 10000 });
const $ = cheerio.load(resp.data);
console.log('Page fetched, looking for links...');
let found = [];
.each((i, el) => {
const href = .attr('href');
const text = .text().trim();
if (href && href.includes('list')) {
found.push([text.substring(0, 50), href]);
}
});
console.log('Found links:', found);
} catch (e) {
console.log('Error:', e.message);
}