from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.PhantomJS()

脚本失败,出现以下错误
---------------------------------------------------------------------------
WebDriverException Traceback (most recent call last)
<ipython-input-3-6658ea2466a9> in <module>()
----> 1 driver = webdriver.PhantomJS()
/Users/yuyang/anaconda/lib/python2.7/site-packages/selenium/webdriver/phantomjs/webdriver.pyc in __init__(self, executable_path, port, desired_capabilities, service_args, service_log_path)
50 service_args=service_args,
51 log_path=service_log_path)
---> 52 self.service.start()
53
54 try:
/Users/yuyang/anaconda/lib/python2.7/site-packages/selenium/webdriver/common/service.pyc in start(self)
79 raise WebDriverException(
80 "'%s' executable needs to be in PATH. %s" % (
---> 81 os.path.basename(self.path), self.start_error_message)
82 )
83 elif err.errno == errno.EACCES:
WebDriverException: Message: 'phantomjs' executable needs to be in PATH.
&#13;
操作系统:OSX
已经安装了phantomjs:
我的错误: