Selenium WebDrivers 修改 Google 浏览器默认下载路径

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
#驱动路径
driver_path=r"E:\Work\selenium\chromedriver.exe"
download_path=r"D:\Project\Data"
url=r"https://support.i-search.com.cn/forward?goto=http%3A%2F%2Ffs.i-search.com.cn%2Fsetup%2FRPAInstall_Mini_support.exe"
#创建Chrome浏览器配置对象实例
options = Options()
#修改配置
options.add_experimental_option("prefs",{
    "download.default_directory" : download_path,
    "download.prompt_for_download" : False,
    "download.directory_upgrade" : True,
    "safebrowsing.enabled" : True
    })

driver=webdriver.Chrome(driver_path,chrome_options=options)
....