根据 this previous question我将 Selenium 更新到 2.0.1 版
但是现在我有另一个错误,即使配置文件存在于 /tmp/webdriver-py-profilecopy
下:
File "/home/sultan/Repository/Django/monitor/app/request.py", line 236, in perform browser = Firefox(profile) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 46, in __init__ self.binary, timeout), File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 46, in __init__ self.binary.launch_browser(self.profile) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 44, in launch_browser self._wait_until_connectable() File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 87, in _wait_until_connectable raise WebDriverException("Can't load the profile. Profile Dir : %s" % self.profile.path) selenium.common.exceptions.WebDriverException: Can't load the profile. Profile Dir : /tmp/webdriver-py-profilecopy
怎么了?我该如何解决这个问题?
最佳答案
更新:
Selenium 团队已在最新版本中修复。对于几乎所有环境,修复方法是:
pip install -U selenium
不清楚它是在哪个版本修复的(显然是 r13122),但肯定到 2.26.0(更新时的当前版本)它已修复。
此错误表示_wait_until_connectable 超时,因为某些原因,代码无法连接到已加载到firefox 中的webdriver 扩展。
我刚刚向 selenium 报告了一个错误,因为我正在尝试使用代理,并且配置文件中的 4 个配置更改中只有 2 个已被 firefox 接受,所以我没有配置代理与分机交谈。不知道为什么会这样……
https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/2061
关于python - Selenium:FirefoxProfile 异常无法加载配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6682009/