profile=webdriver.FirefoxProfile()profile.set_preference("browser.download.dir",os.getcwd());profile.set_preference("browser.download.folderList",2);profile.set_preference("browser.helperApps.neverAsk.saveToDisk","application/csv,application/excel,application/vnd.msexcel,application/vnd.ms-excel,text/anytext,text/comma-separated-values,text/csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/octet-stream");profile.set_preference("browser.download.manager.showWhenStarting",False);profile.set_preference("browser.helperApps.neverAsk.openFile","application/csv,application/excel,application/vnd.msexcel,application/vnd.ms-excel,text/anytext,text/comma-separated-values,text/csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/octet-stream");profile.set_preference("browser.helperApps.alwaysAsk.force",False);profile.set_preference("browser.download.manager.useWindow",False);profile.set_preference("browser.download.manager.focusWhenStarting",False);profile.set_preference("browser.download.manager.alertOnEXEOpen",False);profile.set_preference("browser.download.manager.showAlertOnComplete",False);profile.set_preference("browser.download.manager.closeWhenDone",True);profile.set_preference("pdfjs.disabled",True);
python selenium 下载文件_在python中通过Selenium Webdriver下载文件
最新推荐文章于 2024-04-17 19:14:59 发布