3

After some system updates I'm not able to run webdriver with Firefox using

from selenium import webdriver
driver = webdriver.Firefox()

I get following exception:

selenium.common.exceptions.WebDriverException: 
Message: 
    Expected browser binary location, but unable to find binary in default location, 
    no 'moz:firefoxOptions.binary' capability provided, 
    and no binary flag set on the command line

so I'm wondering what is this default location and, more important, where it defined (script name) so I can set new value or use existed to copy binary into it? I used debugger in PyCharm to find some tips, but with no luck...

Currently Firefox installed into C:\Program Files (x86)\Mozilla Firefox

P.S. I know that I can use Firefox Profile, FirefoxBinary, specify path to geckodriver.exe etc, but I'm not searching for this kind of solution

Andersson
  • 51,635
  • 17
  • 77
  • 129
  • 1
    http://stackoverflow.com/questions/20950748/cannot-find-firefox-binary-in-path-make-sure-firefox-is-installed – Dillon Jan 06 '17 at 13:05
  • 1
    https://github.com/SeleniumHQ/selenium/wiki/FirefoxDriver#important-system-properties –  Jan 06 '17 at 13:22

1 Answers1

2

By default selenium will look into the path - C:\Program Files (x86)\Mozilla Firefox\

Please uninstall older one and install firefox using the link - http://filehippo.com/download_firefox/67599/

you can also look into - Setting path to firefox binary on windows with selenium webdriver

Community
  • 1
  • 1
Karthikeya
  • 324
  • 3
  • 10