How to open Firefox Developer Edition through Selenium

后端 未结 2 1272
栀梦
栀梦 2020-12-02 00:54

Following some tutorials on Selenium, I installed the geckodriver. In order to run a simple code on python to run Selenium, I have to specify this path in the c

2条回答
  •  忘掉有多难
    2020-12-02 01:45

    You can use FirefoxBinary as described here: Setting path to firefox binary on windows with selenium webdriver

    To set the custom path to Firefox you need to use FirefoxBinary:

    from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
    
    binary = FirefoxBinary('F:\FirefoxPortable\Firefox.exe')
    driver = webdriver.Firefox(firefox_binary=binary)
    

提交回复
热议问题