标签:nta 下载文件 set 下载 div test 设置 quit chrome
from selenium import webdriver import time options = webdriver.ChromeOptions() prefs = { ‘profile.default_content_settings.popups‘:0 ,‘download.default_directory‘:‘C:\\Users\\del\\Desktop\\1‘} #设置为0表示禁止弹出窗口, #设置文件下载路径 options.add_experimental_option(‘prefs‘,prefs) driver = webdriver.Chrome(chrome_options=options) driver.get("http://sahitest.com/demo/saveAs.htm") driver.find_element_by_link_text(‘testsaveas.zip‘).click() time.sleep(50) driver.quit()
标签:nta 下载文件 set 下载 div test 设置 quit chrome
原文地址:https://www.cnblogs.com/xiaobaibailongma/p/12081505.html