python - Selenium:FirefoxProfile 异常无法加载配置文件

根据 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

https://stackoverflow.com/questions/17288577/

相关文章:

python - MindWave Mobile - 调用单个数据点

javascript - Xhr 上传事件.loaded 问题

php - 强制文件下载代码在本地主机上工作,但在 php 中的实际服务器上不工作

python - 如何在对象上进行 str.replace?

xaml - Telerik RadMaskedNumericInput 掩码

sql-server - 在 SQL Server 中的数字字段上没有聚合的数据透视

ms-access - 如何在 vba(access) 中将变量设置为我的表单列表框之一?

r - 使用包命名空间在 R 中进行分层 cox 回归

ruby-on-rails - 如何加入 Rails 中的多对多表

sql-server - 对选择结果中的每一行执行 INSERT