簡體   English   中英

如何使用Selenium 3.4.3啟動firefox(不是firefox-bin),

[英]How to launch firefox (not firefox-bin) using Selenium 3.4.3,

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

默認情況下,它通過硒啟動firefox-bin。 我想將過程更改為“ firefox”,而不是“ firefox-bin”。 我嘗試更改site_packages的selenium文件夾中firefox_binary.py中的路徑。 但是它沒有用,它仍然啟動了firefox-bin。

Python版本是2.7

在構建驅動程序時指定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)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM