Python selenium webdriver firefox错误

Python selenium webdriver firefox错误,python,firefox,selenium-webdriver,Python,Firefox,Selenium Webdriver,我正在使用selenium启动firefox 这是我的密码: from selenium import webdriver browser = webdriver.Firefox() browser.get('http://localhost:8000') assert 'Django' in browser.title 它工作了一会儿,然后firefox关闭,我得到以下错误: Traceback (most recent call last): File "functional_te

我正在使用selenium启动firefox 这是我的密码:

from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://localhost:8000')
assert 'Django' in browser.title    
它工作了一会儿,然后firefox关闭,我得到以下错误:

Traceback (most recent call last):
File "functional_tests.py", line 2, in <module>
browser = webdriver.Firefox()
File "/home/hossam/anaconda3/lib/python3.5/site-packages/selenium  /webdriver/firefox/webdriver.py", line 80, in __init__
self.binary, timeout)
File "/home/hossam/anaconda3/lib/python3.5/site-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in __init__
self.binary.launch_browser(self.profile, timeout=timeout)
File "/home/hossam/anaconda3/lib/python3.5/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
self._wait_until_connectable(timeout=timeout)
File "/home/hossam/anaconda3/lib/python3.5/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 108, in _wait_until_connectable
% (self.profile.path))
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: /tmp/tmp7xr9w1rw If you specified a log_file in the FirefoxBinary constructor, check it for details.
回溯(最近一次呼叫最后一次):
文件“functional_tests.py”,第2行,在
browser=webdriver.Firefox()
文件“/home/hossam/anaconda3/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py”,第80行,在__
self.binary,超时)
文件“/home/hossam/anaconda3/lib/python3.5/site packages/selenium/webdriver/firefox/extension_connection.py”,第52行,在u init中__
self.binary.launch_浏览器(self.profile,timeout=timeout)
文件“/home/hossam/anaconda3/lib/python3.5/site packages/selenium/webdriver/firefox/firefox\u binary.py”,第68行,在启动浏览器中
self.\u等待\u直到\u可连接(超时=超时)
文件“/home/hossam/anaconda3/lib/python3.5/site packages/selenium/webdriver/firefox/firefox\u binary.py”,第108行,在“等待”直到“可连接”
%(self.profile.path)
selenium.common.exceptions.WebDriverException:消息:无法加载配置文件。Profile Dir:/tmp/tmp7xr9w1rw如果您在FirefoxBinary构造函数中指定了日志文件,请查看该文件以了解详细信息。

有人能解释一下吗

没有其他问题的可能重复。。在这里,它工作了几秒钟,然后崩溃。stacktrace实际上与另一期相同。你应该试试这里的建议好吧,我试过这个建议,但是它安装了selenium 3,它本身就有问题,我通过安装selenium 2.53.6解决了这个问题