我正在尝试使用Firefox在Selenium测试中下载Jupyter笔记本文件(扩展名x-ipynb+json
)。我使用browser.helperApps.neverAsk.saveToDisk
首选项下载其他MIME类型的文件,而不使用弹出窗口:
profile = webdriver.FirefoxProfile()
profile.set_preference("browser.helperApps.neverAsk.saveToDisk",
"text/html, image/png," # ...others
)
driver = webdriver.Firefox(firefox_profile=profile)
为了获得Jupyter笔记本的相同行为,我根据this加入了application/x-ipynb+json
。你知道吗
我已经手动验证了下载,这是正确的MIME
类型。好像不管用。你知道吗
我使用的配置:
Python 2.7.15rc1
pytest-3.6.1
selenium 3.8.0
geckodriver 0.21.0
目前没有回答
相关问题 更多 >
编程相关推荐