Linux下如何查找firefox插件路径

2024-04-27 00:44:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我需要把我使用的Firefox配置文件的Firefox插件路径。你知道吗

profile = webdriver.FirefoxProfile(plugin_path)
profile.set_preference("webdriver.load.strategy", "fast")

如何在Linux中找到Firefox插件路径,以便在python脚本中传递插件路径


Tags: path路径插件linux配置文件loadfirefoxprofile
1条回答
网友
1楼 · 发布于 2024-04-27 00:44:59

我不知道你为什么要这样加载插件到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

相关问题 更多 >