0
的Python:3.6.0 火狐:53 壁虎:0.16.0 硒:3.3.3如何在硒加载的Firefox配置文件3.3.3
在以下运行我的期望的代码是, URL应该在Firefox中加载,并且配置文件应该是在配置文件中定义的配置文件。相反,每次都会加载一个匿名配置文件。
from selenium import webdriver
profile = webdriver.FirefoxProfile("C:\\Users\\user\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\4dyfyi8v.Profile");
binary = FirefoxBinary('C:\\Program Files\\Mozilla Firefox\\firefox.exe');
ff = webdriver.Firefox(firefox_profile=profile, firefox_binary=binary);
ff.get("http://cbc.ca");
我曾经这么做过,但现在好像已经安装了最新的Firefox和Selenium了。
from selenium import webdriver
fp = webdriver.FirefoxProfile();
fp.set_preference("permissions.default.image",2)
driver = webdriver.Firefox(fp);
有没有办法在配置文件中设置首选项,并使用该配置文件启动硒?旧的方式是有据可查的,但什么机制取代它似乎藏在某处的待办事项清单。