【问题标题】:how to find firefox plugin path in Linux如何在 Linux 中找到 firefox 插件路径
【发布时间】:2016-01-28 17:55:20
【问题描述】:
我需要为我正在使用的 Firefox 配置文件放置 Firefox 插件路径。
profile = webdriver.FirefoxProfile(plugin_path)
profile.set_preference("webdriver.load.strategy", "fast")
如何在 Linux 中找到 Firefox 插件路径,以便我可以在我的 python 脚本中传递 plugin_path
【问题讨论】:
标签:
python
linux
firefox
selenium-webdriver
vnc-viewer
【解决方案1】:
我不确定你为什么要以这种方式将插件加载到FirefoxProfile?文档有一个不同的例子:
File file = new File("firebug-1.8.1.xpi");
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.addExtension(file);
firefoxProfile.setPreference("extensions.firebug.currentVersion", "1.8.1"); // Avoid startup screen
WebDriver driver = new FirefoxDriver(firefoxProfile);
无论如何,Firefox的插件位于~/.mozilla/firefox/MY_PROFILE/extensions