I am trying the following lines
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
opt = Options()
opt.headless = True
opt.add_experimental_option ("debuggerAddress", "localhost:9090")
opt.add_argument("download.default_directory=C:/Users/Future/Desktop")
driver = webdriver.Chrome(executable_path="D:/Webdrivers/chromedriver.exe", options=opt)
driver.switch_to.window(driver.window_handles[0])
The file is downloaded but in the Downloads folder although I tried in the code to change the path of the default folder.
The code is designed to run on an already open browser. Any ideas?