KeyError' sessionId'何时开始幻影

时间:2016-11-11 17:02:00

标签: macos python-3.x selenium phantomjs

当我尝试自己运行phamtonjs时接收到一个很好的回溯:

Traceback (most recent call last):
  File "test_selenium.py", line 4, in <module>
    phantom_brow = webdriver.PhantomJS('phantomjs-2.1.1-macosx/bin/phantomjs')
  File "/Users/me/.virtualenvs/test_bed/lib/python3.5/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 58, in __init__
desired_capabilities=desired_capabilities)
  File "/Users/me/.virtualenvs/test_bed/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__
self.start_session(desired_capabilities, browser_profile)
  File "/Users/me/.virtualenvs/test_bed/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 180, in start_session
self.session_id = response['sessionId']
KeyError: 'sessionId'

以下是所有代码:

from selenium import webdriver

if __name__ == '__main__':
    phantom_brow = webdriver.PhantomJS('phantomjs-2.1.1-macosx/bin/phantomjs')

目前在ElCap背后代理。虽然在我的Windows并行上运行没有问题。

0 个答案:

没有答案