【发布时间】:2015-12-16 00:26:23
【问题描述】:
我正在尝试将 Selenium 绑定用于 Python。当我执行webdriver.Firefox() 时,窗口会打开,但该方法永远不会返回。过了一会儿,窗口再次关闭,我得到以下异常:
>>> driver = webdriver.Firefox()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 77, in __init__
self.binary, timeout),
File "/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/extension_connection.py", line 49, in __init__
self.binary.launch_browser(self.profile)
File "/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
self._wait_until_connectable()
File "/usr/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 103, in _wait_until_connectable
raise WebDriverException("Can't load the profile. Profile "
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.
根据this question,我检查了我的版本。我正在运行 selenium 版本 2.47.3 和 Firefox 版本 40.0.3。两者都是最新的可用版本,因此它们应该是兼容的。
【问题讨论】: