I have a script that I want to run on Linux server That script downloads CSV file from amazon after log in. I have achieved the goal with Chrome web driver (Chromium) using selenium in Python. My question is that Can I run this script on Linux server without headless mode? because when I run script in headless mode the file doesn't download.
If your server does not have a graphical environment, you will need to run Chromium in headless mode. Debugging can be a little bit of a struggle because you cannot directly see what selenium does.
- This post helped me a lot to setup my first headless selenium script
- You may try firefox headless driver. I've seen cases where it worked when Chromium didn't (you will need the geckodriver)
- You can prepare a first version of your Selenium script on a machine where you have a graphical environment and then migrate the script to your headless environment
- As for debugging, I usually dump the visited web pages at different points to see where the script fails (good old "print" debugging)