I\'ve been running the following code in order to download a csv
file from the website http://niftyindices.com/resources/holiday-calendar
:
I have another solution to this problem, since none of the answers here worked for me.
I needed to log into a website, and download some .csv reports. Headed was fine, headless failed no matter what I tried. Looking at the Network errors, the download is aborted, but I couldn't (quickly) determine why.
So, I intercepted the requests and used node-fetch to make the request outside of puppeteer. This required copying the fetch options, body, headers and adding in the access cookie.
Good luck.