繁体   English   中英

使用配置文件路径打开 firefox [selenium webdriver NodeJS]

[英]open firefox with a profile path [selenium webdriver NodeJS]

我正在尝试在 firefox 中打开默认配置文件。 我试过使用:

options.setProfile(path);

但它没有用

我已经设法使用options.addArguments()打开了配置文件,但我无法控制它。 它给出“权限被拒绝”或“连接关闭”

我在 windows 10 上使用“selenium-webdriver 4.0.0-alpha.5”和“firefox 78.0.1(64 位)”

我用这个:

const {Builder} = require('selenium-webdriver');
const firefox = require('selenium-webdriver/firefox');

let options = new firefox.Options();
let profile = '/home/me/.mozilla/firefox/4p90s4py.oss';
options.setProfile(profile);


let driver = new Builder()
        .forBrowser('firefox')
        .setFirefoxOptions(options)
        .build();

希望它有帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM