diff --git a/scrape/scraper.js b/scrape/scraper.js index 0577cb3..2b75ebb 100644 --- a/scrape/scraper.js +++ b/scrape/scraper.js @@ -121,9 +121,8 @@ async function clearDownloadsFolder() { } // Helper: get newest .xlsx file in downloads folder - function getNewestFile(dir, ext = '.xlsx') { + function getNewestFile(dir) { const files = fs.readdirSync(dir) - .filter(f => f.endsWith(ext)) .map(f => ({ name: f, time: fs.statSync(path.join(dir, f)).mtime.getTime() @@ -133,7 +132,7 @@ async function clearDownloadsFolder() { } // Wait for the downloaded file - const downloadedFilePath = getNewestFile(downloadPath, '.xlsx'); + const downloadedFilePath = getNewestFile(downloadPath); if (!downloadedFilePath) { throw new Error('No XLSX file found in download folder'); }