Selenium:FirefoxProfile异常无法加载配置文件 [英] Selenium: FirefoxProfile exception Can't load the profile

查看:599
本文介绍了Selenium:FirefoxProfile异常无法加载配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据上一个问题,我将Selenium更新到2.0版。 1
但现在我有另外一个错误,即使配置文件存在于 / tmp / webdriver-py-profilecopy 下面:

 
执行
browser = Firefox(profile)$ b的文件/home/sultan/Repository/Django/monitor/app/request.py,第236行$ b文件/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py,第46行,在__init__
self.binary,timeout),
文件/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/extension_connection.py,第46行,在__init__
self.binary.launch_browser(self.profile)
文件/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py,第44行,在launch_browser
self._wait_until_connectable()
文件/ USR / local / lib目录/ python2.7 / DIST-包/硒/我们bdriver / firefox / firefox_binary.py,第87行,在_wait_until_connectable
raise WebDriverException(无法加载配置文件。配置文件目录:%s%self.profile.path)
selenium.common.exceptions.WebDriverException:无法加载配置文件配置文件目录:/ tmp / webdriver-py-profilecopy

有什么不对?我该如何解决这个问题? > 更新:



Selenium团队修复了最新版本,对于几乎所有的环境,修正为:


pip安装-U selenium

不清楚哪个版本是固定的(显然<一个href =https://code.google.com/p/selenium/source/detail?r=13122 =nofollow noreferrer> r13122 ),但肯定是2.26.0(目前的时间它是固定的。




这个错误意味着_wait_until_connectable超时,因为某些原因,代码不能连接到已经加载到Firefox的webdriver扩展。

我刚刚报告硒错误在这里我得到这个错误,因为我试图使用代理,配置文件中配置的4个变化中只有2被firefox接受,所以代理没有配置为与扩展。不知道为什么发生这种情况...



https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/2061


Per this previous question I updated Selenium to version 2.0.1 But now I have another error, even when the profile files exist under /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

What is wrong? How can I resolve this issue?

解决方案

Update:

Selenium team fixed in latest version. For almost all environments the fix is:

pip install -U selenium

Unclear at which version it was fixed (apparently r13122), but certainly by 2.26.0 (current at time of update) it is fixed.


This error means that _wait_until_connectable is timing out, because for some reason, the code cannot connect to the webdriver extension that has been loaded into the firefox.

I have just reported an error to selenium where I am getting this error because I'm trying to use a proxy and only 2 of the 4 configured changes in the profile have been accepted by firefox, so the proxy isn't configured to talk to the extension. Not sure why this is happening...

https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/2061

这篇关于Selenium:FirefoxProfile异常无法加载配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆