0

是否可以在 ghost.py 中运行 imacro firefox 脚本?我想自动化繁重的 ajax 网站。

我正在尝试这个:

from ghost import Ghost

ghost = Ghost(plugins_enabled=True,plugin_path=['C:\Documents and Settings\my\Desktop\addons\addon-3863-latest.xpi'],)
4

1 回答 1

1

在 Ghost.py 中,您会找到代码片段:

if plugin_path:
  for p in plugin_path:
    Ghost._app.addLibraryPath(p)

从事物的外观来看,它期待一条路径(addLibraryPath)并且会自行发现。所以,给它一个包含 .xpi 的路径

注意:这未经测试。

在我的 Windows 10 上,我在 Windows 地址栏中输入了这个:

%APPDATA%\Mozilla\Firefox\Profiles

然后我看到一个名为“ kswjuot9.default ”的文件夹(它可能在您的 PC 上被命名为其他东西)并单击它。最后,我找到了一个名为“ extensions ”的文件夹。

尝试给 Ghost.py 这个“ extensions ”文件夹的完整地址。我还建议您使用正斜杠,例如

C:/Users/iChux/AppData/Roaming/Mozilla/Firefox/Profiles/kswjuot9.default/extensions

我看到一个关于如何提取 .xpi 文件的在线链接

于 2016-02-01T10:13:51.453 回答