c# - 如何使用 c# 和 selenium 设置通过 savefileto 插件下载的路径

标签 c# firefox selenium firefox-addon

我正在尝试更改 savefileto (savefileto@mozdev.org) FF 附加组件中的下载文件夹路径,但它不起作用...

profile.SetPreference("extensions.savefileto@mozdev.org.page.recent", "[{\"type\":\"folder\",\"label\":\"pearlcrescent\",\"path\":\"C:\\temp\\pearlcrescent\",\"menu\":false}]

这正是我在启动 FF 之前需要设置的插件。

我试过这些:

\" || "" || ' || \x22

没有成功...

当我在 FF 中设置它时,它看起来像:

extensions.savefileto@mozdev.org.page.recent; type":"folder","label":"pearlcrescent","path":"C:\\temp\\pearlcrescent","menu":false}]

最佳答案

像你一样通过setPreference设置下载文件夹:

profile.SetPreference("browser.download.dir", "c:\\download");

关于c# - 如何使用 c# 和 selenium 设置通过 savefileto 插件下载的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32970444/

相关文章:

google-chrome - 音频/mp4;编解码器 ="mp4a.40.2"无法在 Chrome 和 Firefox 中播放

java - 面临错误,预期条件失败 : waiting for alert to be present (tried for 5 second(s) with 500 milliseconds interval)

c# - StackOverflowException 通过使用具有协变泛型参数的显式接口(interface)实现

c# - 使用 nuget pack 解决一些不安全代码时出错

php - Firefox 将 .zip 文件下载(尝试打开)为 .HTM

python - selenium.common.exceptions.InsecureCertificateException : probably due to HSTS policy

c# - 方法的数据类型

c# - 必须将 GridView 添加到表单标签中进行渲染

oop - 用于自动化测试的页面对象模型对 Web 应用程序有用吗

java - JUnit 中的参数类型不匹配