0

I installed pycharm(python3.6) + selenium(3.8) on my mac.

Trying to run:

from selenium import webdriver
driver=webdriver.Firefox()

I get error:

/Users/ronavaida/PycharmProjects/untitled/venv/bin/python /Users/ronavaida/PycharmProjects/untitled/testselenium.py
Traceback (most recent call last):
  File "/Users/ronavaida/PycharmProjects/untitled/testselenium.py", line 3, in <module>
    driver=webdriver.Firefox()
  File "/Users/ronavaida/PycharmProjects/untitled/venv/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 158, in __init__
    keep_alive=True)
  File "/Users/ronavaida/PycharmProjects/untitled/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 154, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/Users/ronavaida/PycharmProjects/untitled/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/Users/ronavaida/PycharmProjects/untitled/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 311, in execute
    self.error_handler.check_response(response)
  File "/Users/ronavaida/PycharmProjects/untitled/venv/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 237, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

Please advise, thanks!

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • The version of FF you use is probably not matching the version of webdriver that is installed. See https://github.com/SeleniumHQ/selenium/issues/4927 – BoboDarph Dec 06 '17 at 13:41
  • @Rona Vaida If you solved your current issue do not change exception log in this ticket, but create new ticket regarding your new issue... – Andersson Dec 06 '17 at 14:09

1 Answers1

0

The error you are seeing says it all :

SessionNotCreatedException: Message: Unable to find a matching set of capabilities

You need to download the latest geckodriver binary from this linkand save it in your system and provide the absolute path of the geckodriver binary while initializing the WebDriver and Browser instance as follows :

from selenium import webdriver

driver = webdriver.Firefox(executable_path=r'C:\path\to\geckodriver.exe')
driver.get('https://www.google.co.in')
driver.quit()
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352