Node.js puppeteer - Downloading and opening a .idx file
I'm using node.js and puppeteer to get some data. I can click/download a .idx file ... but how can I then open it and process the data?
const tableRows = await page.$$('table > tbody tr');
console.log(tableRows.length);
let tableCell01;
let tableCell01Val;
for (let i=1; i < tableRows.length; i++){
tableRow = tableRows[i];
tableCell01 = await tableRow.$('td:nth-child(1) a');
tableCell01Val = await page.evaluate( tableCell01 => tableCell01.href, tableCell01 );
const tableLink = await page.$('table > tbody tr td:nth-child(1) a');
const tableLinkVal = await page.evaluate( tableLink => tableLink.href, tableLink );
console.log(tableLinkVal);
await page.goto(tableLinkVal, {waitUntil: 'load'});
}
I can see that it downloads ... but then I get this error
Error: net::ERR_ABORTED at /file.20180702.idx
at navigate (/node_modules/puppeteer/lib/Page.js:602:37)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)