

What could be the issue?Īwait page.goto(' ) Ī.href = window.URL. The page finished loading, and I increased the timeout, but it still fails.

This happens both with headless true and false.

Problem is that the CSV is downloaded empty and with an error. You should find Puppeteer executes successfully, provided proper Chrome flags are used.I have an application that shows a page, the user clicks on a button, and downloads a CSV file. Chrome will write into /tmp instead.Īdd your JavaScript to your container with a COPY instruction. Since the official announcement of Chrome Headless, many of the industry standard libraries for automated testing have. disable-dev-shm-usage – This flag is necessary to avoid running into issues with Docker’s default low shared memory space of 64MB. Puppeteer is the official tool for Chrome Headless by Google Chrome team.If you’re uncomfortable with this, you’ll need to manually configure working Chrome sandboxing, which is a more involved process. mmacaula I am looking for a way to download a file when Chrome is running in headless mode. It’s vital you ensure your Docker containers are strongly isolated from your host. Using these flags could allow malicious web content to escape the browser process and compromise the host. It requires zero setup and comes bundled with the Chromium version most suited to it. no-sandbox and disable-setuid-sandbox – These disable Chrome’s sandboxing, a step which is required when running as the root user (the default in a Docker container). Downloads: 4 This Week Last Update: 3 days ago Download Summary Files Reviews Puppeteer is a headless Node library that provides a high level API for controlling Chromium or Chrome over the DevTools protocol.local-chromium/ directory and used npm init and npm i -save puppeteer to set it up. I'm running this on a macOS Sierra (MacBook Pro) using puppeteer version 1.1.1 which pulls Chromium version. Setting this flag explicitly instructs Chrome not to try and use GPU-based rendering. with headless: false it works, it downloads the file into /Users/user/Downloads. disable-gpu – The GPU isn’t usually available inside a Docker container, unless you’ve specially configured the host.
