N8N Puppeter - Download pdf from a button behind login

Describe the problem/error/question

I’m currently attempting to automate a task where i download the attached pdf of recently posted mails in a custom email site. In every email there exists a button that downloads the pdf. I have only recently learned of Puppeteer, so is there a method on how to download pdfs from buttons past a login for the puppeteer node?

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Windows

Yes, you can download those PDFs with Puppeteer :+1:
First, make Puppeteer log in to your email site, then open each email and click the download button for the PDF.
You just need to allow file downloads using:

Page.setDownloadBehavior

After that, the PDFs will save automatically :page_facing_up:

Since you’re using n8n in Docker, make sure the download folder is allowed in the container. If you want, I can also share a simple code example!