selenium webdrive 默认打开浏览器设置

一、打开cmd

1. cd C:\program files\mozilla firefox(Firefox安装目录)

2. 执行: firefox.exe -ProfileManager -no-remote



二、增加新的配置

在打开的窗口中(上图)选择创建配置文件,完事点击【启动Firefox】

 

三、将新生成的配置文件指定给selenium webdrive

1. 生成配置文件路径:C:\Users\zach\AppData\Roaming\Mozilla\Firefox\Profiles\

2. 将生成的配置文件写入代码

browser_path = 'C:\Users\zach\AppData\Roaming\Mozilla\Firefox\Profiles\gfk3atbn.selenium'

driver = webdriver.Firefox(browser_path)

 

posted on 2017-12-20 16:06  fengZQ  阅读(2750)  评论(0编辑  收藏  举报

导航