UNPKG

@accounter/modern-poalim-scraper

Version:
28 lines 940 B
// Script to test out MAX scraping. Run with: // tsx packages/modern-poalim-scraper/src/test/scrape-max.ts import dotenv from 'dotenv'; import { init } from '../index.js'; dotenv.config({ path: [`.env`, `../../.env`] }); async function main() { if (!process.env['MAX_USERNAME'] || !process.env['MAX_PASSWORD']) throw new Error('MAX_USERNAME and MAX_PASSWORD must be set'); const { max, close } = await init({ headless: true }); try { const scraper = await max({ username: process.env['MAX_USERNAME'], password: process.env['MAX_PASSWORD'], }); const transactions = await scraper.getTransactions(); console.log(transactions); } catch (error) { console.error(error); } finally { console.debug('closing'); await close(); console.debug('done'); } } main().catch(console.error); //# sourceMappingURL=scrape-max.js.map