Hi,
I have a selenium-based script that is working perfectly on my local machine and on another cloud provider's service. Unfortunately, when I try it on PythonAnywhere everything works up until the moment where a file is downloaded. No error is output, the file is simply never downloaded to the intended directory. I've taken screenshots and confirmed the automation is occuring as expected. I've also configured various settings in an attempt to overcome these issues. My setup is as follows:
downloadpath = '/home/exampledirectory/downloads/
chrome_options = Options()
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--safebrowsing-disable-download-protection")
chrome_options.add_argument("window-size=1440,900")
chrome_options.add_argument('--disable-software-rasterizer')
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_experimental_option("prefs", {
"download.default_directory": downloadpath,
"download.prompt_for_download": False,
"download.directory_upgrade": True,
"safebrowsing_for_trusted_sources_enabled": False,
"safebrowsing.enabled": False
})
browser = webdriver.Chrome(options=chrome_options)
Any ideas why this setup works elsewhere but not on PythonAnywhere?