I am trying to download some csv files using selenium webdriver from dynamic loaded website where i need to click buttons to get my file downloaded. However when i run my python script in my local machine all files will get downloaded but same script wont download files in AWS Linux server machine. It neither gives me an error during the downloads.
arguments I added for driver
options = Options()
options.binary_location = GoogleChrome_Path
options.add_argument("--headless")
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
options.add_experimental_option("prefs", {"download.default_directory": SomeFolder,
"download.prompt_for_download": False,
"download.directory_upgrade": True,
"safebrowsing.enabled": True
})
And right after this i will perform some click operations to download the file and as i have stated above when it executes in the Linux server machine the files wont get downloaded and also the script does not throw any error
How do i know that file wont get downloaded? well, I check the files in save path folder using
os.listdir(SomeFolder)
Is there any way that I can find out what is causing this issue
Element tag that I am trying to click
<a title="CSV (comma delimited)" alt="CSV (comma delimited)" onclick="$find('ctl_ReportViewer').exportReport('CSV');" href="javascript:void(0)" style="color: rgb(51, 102, 204); font-family: Verdana; font-size: 8pt; padding: 3px 8px 3px 32px; display: block; white-space: nowrap; text-decoration: none;">CSV (comma delimited)</a>
Source URL https://apps.who.int/flumart/Default?ReportNo=12
select random drop down values and click display report and it takes some seconds to load the report. after completely loaded we can see blue color button(Export drop down menu) click that button and export to csv
I am just having problem while clicking export as a csv.
