title: How to properly use selenium with geckodriver and firefox with python on Ubuntu?
body: <p>I am trying to use the geckodriver with firefox and selenium on my Ubuntu machine. This is the code I have so far:</p>
  
  <pre><code>from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
  from selenium.webdriver.firefox.options import Options
  from selenium.webdriver.common.keys import Keys
  from selenium import webdriver
  
  
  #path where browser is installed
  binary = '/usr/bin/firefox'
  options = webdriver.FirefoxOptions()
  options.binary = binary
  options.add_argument('start-maximized')
  options.add_argument('--headless')
  
  
  cap = DesiredCapabilities().FIREFOX
  cap["marionette"] = False
  
  
  path_to_driver = "/home/andrea/geckodriver"
  
  # run firefox webdriver from executable path 
  driver = webdriver.Firefox(firefox_options=options, capabilities=cap, executable_path = path_to_driver)
  #driver = webdriver.Firefox(capabilities=cap, executable_path = path_to_driver)
  
  
  driver.get("https://www.amboss.com/us/account/login")
  
  </code></pre>
  
  <p>Despite that I am getting the following error:</p>
  
  <pre><code>selenium.common.exceptions.WebDriverException: Message: Can't load the profile. 
  Possible firefox version mismatch. You must use GeckoDriver instead for Firefox 48+. Profile Dir: /tmp/tmpuigrk9f7 If you specified a log_file in the FirefoxBinary constructor, check it for details.
  </code></pre>
  
  <p>The firefox version which I work with is:
  <code>Mozilla Firefox 68.0.2</code></p>
  
  <p>Does anyone have any idea as to how I could go about fixing this?</p>