我需要为我正在使用的 Firefox 配置文件放置 Firefox 插件路径。
profile = webdriver.FirefoxProfile(plugin_path)
profile.set_preference("webdriver.load.strategy", "fast")
如何在 Linux 中找到 Firefox 插件路径,以便我可以在我的 python 脚本中传递 plugin_path
我需要为我正在使用的 Firefox 配置文件放置 Firefox 插件路径。
profile = webdriver.FirefoxProfile(plugin_path)
profile.set_preference("webdriver.load.strategy", "fast")
如何在 Linux 中找到 Firefox 插件路径,以便我可以在我的 python 脚本中传递 plugin_path
我不确定你为什么要以这种方式加载插件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