Python 含PhantomJS的Selenium给出了KeyError:';sessionId';尝试启动会话时

Python 含PhantomJS的Selenium给出了KeyError:';sessionId';尝试启动会话时,python,macos,selenium,phantomjs,Python,Macos,Selenium,Phantomjs,我试图在Mac上将Selenium(2.47.3)与PhantomJS(2.0.0)一起使用,但收到标题中的错误。Python是3.5.0 Traceback (most recent call last): File "/Users/QuickSilver/Desktop/autocrawlerfinal.py", line 31, in <module> driver = webdriver.PhantomJS('/Users/QuickSilver/Desktop/crawle

我试图在Mac上将Selenium(2.47.3)与PhantomJS(2.0.0)一起使用,但收到标题中的错误。Python是3.5.0

Traceback (most recent call last):
File "/Users/QuickSilver/Desktop/autocrawlerfinal.py", line 31, in <module>
driver = webdriver.PhantomJS('/Users/QuickSilver/Desktop/crawler/phantomjs-2.0.0-macosx/bin/phantomjs', port=631)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 56, in __init__
desired_capabilities=desired_capabilities)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 87, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 143, in start_session
self.session_id = response['sessionId']
KeyError: 'sessionId'

在线上唯一提到此错误的是系统代理,但没有,并且localhost也添加到了异常中。是什么导致了这种情况?

有时会在这里看到类似的问题。selenium==2.48.0,phantomjs=2.0.1-development,Python 2.7.10键错误:139850984293008
from selenium import webdriver
driver = webdriver.PhantomJS('/Users/QuickSilver/Desktop/crawler/phantomjs-2.0.0-macosx/bin/phantomjs', port=631)