我有一个自动化脚本,在最近的mozilla更新之前运行得很好。selenium python脚本自动执行一些浏览器操作,并将某些报告(csv)保存到定义的位置。在
我一直在使用selenium 2.53.6,它使用以下代码:
profile = webdriver.firefox.firefox_profile.FirefoxProfile()
profile.set_preference('browser.helperApps.neverAsk.saveToDisk',"text/csv, application/pdf,application/octet-stream")
profile.set_preference('browser.download.folderList',2)
profile.set_preference("browser.download.manager.showWhenStarting",False)
profile.set_preference('browser.download.dir','D:\Downloads')
driver = webdriver.Firefox(firefox_profile=profile)
目前我使用的是selenium Python3.0.1和Firefox48。在这里,我将geckodriver路径添加到环境变量中,并能够使用以下代码启动firefox:
^{pr2}$我很好奇如何在firefox木偶驱动程序中做一个profile.set_preference
等效的功能。我找不到任何关于它的文件。在
请告知。在
您也可以传递} 作为:-
profile
来启动^{也可以将
^{pr2}$firefox_profile
设置为capabilities
为:相关问题 更多 >
编程相关推荐