[formatted by admin]
from pyvirtualdisplay import Display
from selenium import webdriver
with Display():
print ('start')
# driver = webdriver.Firefox()
import os
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.set_preference('browser.download.folderList', 2)
profile.set_preference('browser.download.manager.showWhenStarting', False)
profile.set_preference('browser.download.dir', os.getcwd())
profile.set_preference('browser.helperApps.neverAsk.saveToDisk', 'text/csv/xls')
profile.set_preference("browser.helperApps.neverAsk.saveToDisk","text/csv,application/x-msexcel,application/excel,application/x-excel,application/vnd.ms-excel,image/png,image/jpeg,text/html,text/plain,application/msword,application/xml")
profile.set_preference("browser.helperApps.neverAsk.openFile","text/csv,application/x-msexcel,application/excel,application/x-excel,application/vnd.ms-excel,image/png,image/jpeg,text/html,text/plain,application/msword,application/xml")
driver = webdriver.Firefox(profile)
# driver = webdriver.Chrome(executable_path=path,options=options)
driver.get('website link')
# driver = webdriver.ChromeOptions()
username = driver.find_element_by_id("username")
password = driver.find_element_by_id("password")
username.send_keys('******'')
password.send_keys('*******')
time.sleep(2)
driver.find_element_by_name("login").click()
time.sleep(3)
driver.find_element_by_xpath("/html/body/div[1]/div/div[2]/ul[1]/li[3]/a").click()
#login
print ('done')
time.sleep(2)
driver.find_element_by_xpath("/html/body/div[1]/div/div[2]/ul[1]/li[4]/a").click()
time.sleep(3)
print ('done')
driver.find_element_by_xpath("/html/body/div[1]/div/div[2]/ul[1]/li[4]/ul/li[8]/a").click()
time.sleep(2)
driver.find_element_by_css_selector('#download_csv').click()
time.sleep(120)
driver.close()
driver.quit()
print ('done')
my code for the project, the code run without any error, but I cannot found the file. where I can find the downloaded file, which part of my code need to change or add for me to find the downloaded file in path "home/username"