0

environment: mac osx 10.11.2, python 2.7, selenium-3.0.0.b2, firefox 45

I just create a python file and run , code is

/**
from selenium import webdriver
import time
dr = webdriver.Firefox()
time.sleep(5)
print 'Browser will be closed'
dr.quit()
print 'Browser is close'
**/

then report error:

File "/Library/Python/2.7/site-packages/selenium-3.0.0.b2-py2.7.egg/selenium/webdriver/firefox/webdriver.py", line 65, in init self.service.start()

File "/Library/Python/2.7/site-packages/selenium-3.0.0.b2-py2.7.egg/selenium/webdriver/common/service.py", line 71, in start os.path.basename(self.path), self.start_error_message)

selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

I have got a file geckodriver,maybe I know this error because of I didn't set path,but, I don't know how to set this PATH in Mac?

任思豪
  • 21
  • 2
  • 4
    So did you search for 'mac add to path' on google yet? This is question isn't about Python, or PyCharm, or Selenium, really. – Martijn Pieters Aug 28 '16 at 09:01
  • I have did in commond line like : export PATH$PATH:/Users/MYNAME/geckodriver but it doesn't work, always report error , why? please help me ,thanks! – 任思豪 Aug 28 '16 at 09:43

0 Answers0