Chrome 文件下载
Chrome浏览器类似,设置其options:
download.default_directory
:设置下载路径profile.default_content_settings.popups
:设置为0
禁止弹出窗口
options = webdriver.ChromeOptions() prefs = {'profile.default_content_settings.popups': 0, 'download.default_directory': 'd:\\'} options.add_experimental_option('prefs', prefs) driver = webdriver.Chrome(chrome_options=options) driver.maximize_window()
查找下载的文件
import os a = os.listdir("d:") for i in a: print(i)
来源:https://www.cnblogs.com/royfans/p/9210463.html