I am trying to download a file using Selenium with chromedriver and python3. My code works perfectly with Windows OS, but when I try to execute the same code on amazon EC2, everythings fine, no erros, all elements are found but no file downloaded in the specific directory? I am using the code below, any idea ?
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
prefs = {"download.default_directory" : '/my_directory/'}
chrome_options.add_experimental_option("prefs",prefs)
chrome_options.add_argument('--headless')
browser= webdriver.Chrome(options=chrome_options)