Closed ilyanoskov closed 4 years ago
Hi @ilyanoskov
First, thank you for using this image and opening a bug. š
I will look at this issue in 4 hours.
š¤ I do not understand why you got an TimeoutError
.
Can you share to me the js
file you're running with playwright? š
Thanks again.
@jlandure thanks for the fast response.
The script is very straightforward, it's just navigating to a page and clicking "download file" button.
Here is a part of the script that times out:
const [ download ] = await Promise.all([
page.waitForEvent('download'), // <-- start waiting for the download
page.click('/div/div[2]/div[2]/button') // <-- perform the action that directly or indirectly initiates it.
]);
const url = await download.url();
const path = await download.path();
It executes fine outside of the container, but not inside.
Unfortunately the page I am trying to download the file on is behind a login, so you won't be able to reproduce it with my script. However, you could just try running the playwright script to download any file from anywhere (like pastebin.com) and see whether it actually downloads one?
@jlandure do you have any pointers in which direction I could look? I am trying to make this work or abandon the solution :) Thanks a lot in advance
Hi @ilyanoskov
Sorry for the delay. š
Did you find a solution for your problem? Do you have a working example outside the container to help me reproduce your problem?
Thanks again. š
@jlandure I was able to use the official Microsoft playwright docker container for this. worked flawlessly!
Describe the bug I am trying to download a file programmatically. The script runs fine outside of the container, but fails to download the file when I run it inside the container. All other steps in the Playwright script execute OK.
this is how I run my container :
docker container run -it --rm --ipc=host --security-opt seccomp=chrome.json -v $(pwd)/src:/usr/src/app/src ilyaanoskov/file-downloader node src/index
What is the expected behavior? The expected behavior is that the script downloads the file locally to a /tmp folder (just like Playwright does) and then I upload this file to S3
What is the actual behavior? The script fails to download the file, hanging in the process
Logs