0
Selenium不能在ubunutu上工作 - KeyError:'sessionId'。Selenium不能在ubunutu上工作 - KeyError:'sessionId'
我該怎麼做?
from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(800, 600))
display.start()
browser = webdriver.Firefox()
browser.get('http://www.python.org')
browser.close()
錯誤:
Traceback (most recent call last):
File "/home/user/Installed/pycharm-2017.1/helpers/pydev/pydevd.py", line 1578, in <module>
globals = debugger.run(setup['file'], None, None, is_module)
File "/home/user/Installed/pycharm-2017.1/helpers/pydev/pydevd.py", line 1015, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "selenium-wtf.py", line 7, in <module>
browser = webdriver.Firefox()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 150, in __init__
keep_alive=True)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 180, in start_session
self.session_id = response['sessionId']
KeyError: 'sessionId'
更多的文字 更多的文字 更多的文字 更多的文字 更多的文字 更多的文字 更多的文字 更多的文字 更多的文字 更多的文字