The first, unnamed parameter when using webdriver.Firefox()
is firefox_profile
, which takes either a FirefoxProfile
object or a string. If it's a string, you're telling the Python language bindings what directory you want to use as the template for the anonymous profile used when launching Firefox.
Other answers may have you attempting to use the firefox_binary
argument. This is incorrect, as that is the argument specifying the path to the Firefox binary, not the geckodriver binary.
The argument you actually want to use is executable_path
, which is the argument that refers to the location of the geckodriver
binary. To wit, you want something like the following:
browser = webdriver.Firefox(executable_path='C:\\Users\\ojadi\\Downloads\\geckodriver-v0.26.0-win64\\geckodriver.exe')
Now, if you also need to specify a path to a specific Firefox binary installation, you can specify both firefox_binary
and executable_path
.