How to install firefoxdriver webdriver for python3 selenium on ubuntu 16.04?
<p>I installed python3-selenium apt package on Ubuntu 16.04. While installing, got a message:</p>

<pre><code>Suggested packages:
chromedriver firefoxdriver
The following NEW packages will be installed:
python3-selenium
</code></pre>

<p>When I try to run the following python code,</p>

<pre><code>#! /usr/bin/python3.5
from selenium import webdriver
import time

def get_profile():
    profile = webdriver.FirefoxProfile()
    profile.set_preference("browser.privatebrowsing.autostart", True)
    return profile

def main():
    browser = webdriver.Firefox(firefox_profile=getProfile())

    #browser shall call the URL
    browser.get("http://www.google.com")
    time.sleep(5)
    browser.quit()

if __name__ == "__main__":
    main()
</code></pre>

<p>I get the following error:</p>

<blockquote>
  <p>Traceback (most recent call last):
          File "./test.py", line 19, in 
              main()
          File "./test.py", line 11, in main
              browser = webdriver.Firefox(firefox_profile=getProfile())
          File "/usr/lib/python3/dist-packages/selenium/webdriver/firefox      /webdriver.py", line 77, in <strong>init</strong>
      self.binary, timeout),
          File "/usr/lib/python3/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in <strong>init</strong>
      self.profile.add_extension()
          File "/usr/lib/python3/dist-packages/selenium/webdriver/firefox/firefox_profile.py", line 91, in add_extension
      self._install_extension(extension)
          File "/usr/lib/python3/dist-packages/selenium/webdriver/firefox/firefox_profile.py", line 251, in _install_extension
      compressed_file = zipfile.ZipFile(addon, 'r')
         File "/usr/lib/python3.5/zipfile.py", line 1009, in <strong>init</strong>
      self.fp = io.open(file, filemode)
      FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib /firefoxdriver/webdriver.xpi'</p>
</blockquote>

<p>I did searching for packages name firefoxdriver in Ubuntu repositories but none exist.
How do I solve this problem?</p>

<p>Any help with installing the webdrivers appreciated!</p>

<p>I'm not certain if this will fix the issue you're having, but you can give it a try.  But first, to answer the question as to where you can download firefoxdriver, my answer would be <strong>maybe firefoxdriver is not available, because the file is now called geckodriver, but it's really called Marionette Driver.</strong>  It's described here: <a href="https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver" rel="nofollow">https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver</a> , and it's made available here <a href="https://github.com/mozilla/geckodriver/releases" rel="nofollow">https://github.com/mozilla/geckodriver/releases</a></p>

<p>That answers the question, I believe, however I'd like to try to address the issue you're having.</p>

<p><strong>My understanding of your issue:</strong>
You're trying to spawn an instance of firefox, through selenium, but it's not working.</p>

<p><strong>My hypothesis as to why it's not working:</strong>
Maybe you're using Firefox 47 or newer. If you're looking for where to downlad the new 'firefoxdriver' (its called the Marionette Driver, but the file is called geckodriver), you'll have to download the file directly from its github release page: <a href="https://github.com/mozilla/geckodriver/releases" rel="nofollow">https://github.com/mozilla/geckodriver/releases</a> (I suggest downloading v0.9.0, since v0.10.0 hasn't worked for me).</p>

<p>If you're using Firefox 47 or newer, then starting up Firefox browser with a simple <code>browser = webdriver.Firefox()</code> just isn't going to work.  This used to work for Firefox 46, and I'm assuming older versions, however it no longer works because support for Firefox Webdriver has now been dropped.  You now have to download the new Marionette driver, and modify your code a bit to make it work with this new driver. You can learn more about Marionette in the link I provided above.</p>

<p><strong>The solutions I'm proposing</strong>
You can either:</p>

<ol>
<li>Download and downgrade to Firefox 46</li>
</ol>

<p>or </p>

<ol start="2">
<li>Download the new Marionette driver and adapt your code to work with it</li>
</ol>

<p>If you choose option #1, then simply find a way to downgrade to Firefox 46. </p>

<p>If however you want your code to work with the most recent release of Firefox, then you choose option #2 and the basic gist of how to accomplish that is as follows:</p>

<ol>
<li>Download and extract the driver</li>
<li>Make sure that your OS can find the file in its systempath</li>
<li>Modify your code to work with the new Marionette webdriver</li>
</ol>

<p>The specific <strong>step by step process</strong> (for ubuntu) can be found in this stackoverflow answer <a href="https://stackoverflow.com/questions/39478101/launch-selenium-from-python-on-ubuntu/39536091#39536091">launch selenium from python on ubuntu</a></p>

<p>selenium should be able to spawn firefox normally once that's done.</p>

python python-3.x selenium selenium-webdriver python-3.5