2017-09-19 44 views
0

我想在Mac OSX 10.12.2上使用selenium 3.4.3啓動firefox進程(不是firefox-bin)。我有GeckoDriver版本0.18.0和Firefox版本55.0如何使用Selenium啓動Firefox(不是Firefox)3.4.3,

默認情況下,它通過硒啓動firefox-bin。我想將流程改爲'firefox'而不是'firefox-bin'。我試着在site_packages的selenium文件夾中更改firefox_binary.py的路徑。但它沒有奏效,它仍然啓動了firefox-bin。

Python版本是2.7

回答

0

指定生成驅動程序時的firefox可執行文件。

from selenium.webdriver.firefox.firefox_binary import FirefoxBinary 

// replace the path to path of your firefox process, please use absolute path 
// and make your account has the execution right on the firefox process 
binary = FirefoxBinary('F:\FirefoxPortable\Firefox.exe') 
driver = webdriver.Firefox(firefox_binary=binary) 
相關問題