【发布时间】:2014-03-29 17:32:47
【问题描述】:
要在定义 selenium webdriver 之前明确定义下载目录,我们使用以下代码:
chromeOptions = webdriver.ChromeOptions()
prefs = {"download.default_directory" : "C:/data/cline"}
chromeOptions.add_experimental_option("prefs",prefs)
chromePath = "path to chromedriver"
driver = selenium.webdriver.chrome.webdriver.WebDriver(executable_path=chromePath, port=0, chrome_options=chromeOptions, service_args=None, desired_capabilities=None, service_log_path=None)
我想下载多个文件,每个文件到不同的(新创建的)目录。定义驱动后是否可以更改下载目录?
【问题讨论】: