Python的:硒Firefox的Webdriver失败,错误:'无法加载配置文件... WARN addons.xpi ..." [英] Python: Selenium Firefox Webdriver failing with error: 'Can't load the profile...WARN addons.xpi..."

查看:219
本文介绍了Python的:硒Firefox的Webdriver失败,错误:'无法加载配置文件... WARN addons.xpi ..."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行下面的Python代码来通过Selenium创建一个Firefox Webdriver窗口:

  from selenium import webdriver 
driver = webdriver.Firefox()
driver.get(http://www.google.com)

虽然这段代码在几个星期前工作的很好,但是它现在产生了下面的预感信息:

  Traceback(最近一次调用的最后一个):
在< module>文件中的test.py,第2行。
driver = webdriver.Firefox()
文件c:\python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py,第60行, __init__
self.binary,timeout),
文件c:\python27\lib\site-packages\selenium\webdriver\firefox\extension_connection.py,第47行, in __init__
self.binary.launch_browser(self.profile)
文件c:\python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py第61行,在launch_browser
self._wait_until_connectable()
文件c:\python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py,第105行,在_wait_until_connectable
self.profile.path,self._get_firefox_output()))
selenium.common.exceptions.WebDriverException:消息:'无法加载配置文件。配置文件目录:c:\\ users \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\
*** WARN addons.xpi:忽略C:\\ Program Files中缺少的附加组件\\ CheckPoint\\ZAForceField\\WOW64\\TrustChecker\r\ n *** WARN addons.xpi:忽略C:\\ProgramData\\Norton\\ {78CA3BF0-9C3B-40e1-B46D-38C877EF059A} \\NSM_2.9.5中的缺失加载项。 20 \\coFFFw\r\\\
*** LOG addons.xpi:跳过不可用的安装位置app-system-local \r\\\
*** LOG addons.xpi:跳过不可用的安装位置app-system -share\r\\\
*** LOG addons.xpi:checkForChanges\r\\\
*** LOG addons.xpi:找不到更改\r\\\
*** Blocklist :: _ loadBlocklistFromFile:blocklist is disabled\r\\\
******************************************* ***************** \r\\\
*呼吁xpconnect wr apped JSObject产生这个错误:* \r\\\
[Exception ...\'[JavaScript错误:this._defaultEngine为空{file:resource://gre/components/nsSearchService.jsline调用方法:[nsIBrowserSearchService :: currentEngine]nsresult:0x80570021(NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)location:JS frame :: chrome://browser/content/search/search.xml :: get_currentEngine: :第130行data:yes] \r\\\
************************************ ************************ \r\\\
******************** **************************************** \r\\\
*致电xpconnect包裹的JSObject产生这个错误:* \r\\\
[Exception ...\'[JavaScript Error:this._defaultEngine is null{file:resource://gre/components/nsSearchService.jsline :3527}] \'当调用方法:[nsIBrowserSearchService :: currentEngine]nsresult:0x80570021(NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)location:JS frame :: chrome:// brows er / content / search / search.xml :: get_currentEngine :: line 130data:yes] \r\\\
*********************** ************************************* \r\\\
******* ************************************************** *** \r\\\
*调用xpconnect包装的JSObject产生这个错误:* \r\\\
[Exception ...\'[JavaScript Error:this._defaultEngine is null{file:资源://gre/components/nsSearchService.jsline:3527}] \'当调用方法:[nsIBrowserSearchService :: currentEngine]nsresult:0x80570021(NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)位置:JS frame :: resource:// app / components / nsBrowserGlue.js ::< TOP_LEVEL> :: line 354data:yes] \r\\\
*********************************** ************************* \r\\\
******************* ******************************打电话给xpconnect包裹的JSObject产生这个错误:* \r\\\
[Exception ...\'[JavaScript Error:this._defaultEngine is null{file:resource://gre/components/nsSearchService.js当调用方法:[nsIBrowserSearchService :: currentEngine]nsresult:0x80570021(NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)location:JS frame :: resource://app/components/nsBrowserGlue.js ::< TOP_LEVEL> ; :: line 354data:yes] \r\\\
*********************************** ************************* \r\\\
'

有人知道这意味着什么,或者我可以做些什么来纠正错误并让代码按预期运行?我通过Google搜索找到了相关的错误消息,但没有已经让我解决了这个问题。

对于这个价值,我可以通过将上面的第二行更改为 driver = webdriver.Chrome()。



我使用Python 2.7,Selenium 2.35.0(我刚跑了pip install selenium - 升级)和Windows 8机器上的Firefox 26.0。任何提示或建议,他人可以提供的是最受赞赏的。

解决方案

Selenium 2.35不兼容Firefox 26.作为发布说明说,FF 2. 26支持被添加。你需要更新到2.39。试试 pip install -U selenium


I am trying to run the following Python code to create a Firefox Webdriver window via Selenium:

from selenium import webdriver
driver = webdriver.Firefox()
driver.get("http://www.google.com")

While this code worked fine a few weeks ago, it now produces the following foreboding message:

 Traceback (most recent call last):
  File "test.py", line 2, in <module>
    driver = webdriver.Firefox()
  File "c:\python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 60, in __init__
    self.binary, timeout),
  File "c:\python27\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
  File "c:\python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 61, in launch_browser
    self._wait_until_connectable()
  File "c:\python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 105, in _wait_until_connectable
    self.profile.path, self._get_firefox_output()))
selenium.common.exceptions.WebDriverException: Message: 'Can\'t load the profile. Profile Dir: c:\\users\\douglas\\appdata\\local\\temp\\tmpuf4ipq Firefox output: *** LOG addons.xpi: startup\r\n*** WARN addons.xpi: Ignoring missing add-on in C:\\Program Files\\CheckPoint\\ZAForceField\\WOW64\\TrustChecker\r\n*** WARN addons.xpi: Ignoring missing add-on in C:\\ProgramData\\Norton\\{78CA3BF0-9C3B-40e1-B46D-38C877EF059A}\\NSM_2.9.5.20\\coFFFw\r\n*** LOG addons.xpi: Skipping unavailable install location app-system-local\r\n*** LOG addons.xpi: Skipping unavailable install location app-system-share\r\n*** LOG addons.xpi: checkForChanges\r\n*** LOG addons.xpi: No changes found\r\n*** Blocklist::_loadBlocklistFromFile: blocklist is disabled\r\n************************************************************\r\n* Call to xpconnect wrapped JSObject produced this error:  *\r\n[Exception... "\'[JavaScript Error: "this._defaultEngine is null" {file: "resource://gre/components/nsSearchService.js" line: 3527}]\' when calling method: [nsIBrowserSearchService::currentEngine]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://browser/content/search/search.xml :: get_currentEngine :: line 130"  data: yes]\r\n************************************************************\r\n************************************************************\r\n* Call to xpconnect wrapped JSObject produced this error:  *\r\n[Exception... "\'[JavaScript Error: "this._defaultEngine is null" {file: "resource://gre/components/nsSearchService.js" line: 3527}]\' when calling method: [nsIBrowserSearchService::currentEngine]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://browser/content/search/search.xml :: get_currentEngine :: line 130"  data: yes]\r\n************************************************************\r\n************************************************************\r\n* Call to xpconnect wrapped JSObject produced this error:  *\r\n[Exception... "\'[JavaScript Error: "this._defaultEngine is null" {file: "resource://gre/components/nsSearchService.js" line: 3527}]\' when calling method: [nsIBrowserSearchService::currentEngine]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: resource://app/components/nsBrowserGlue.js :: <TOP_LEVEL> :: line 354"  data: yes]\r\n************************************************************\r\n************************************************************\r\n* Call to xpconnect wrapped JSObject produced this error:  *\r\n[Exception... "\'[JavaScript Error: "this._defaultEngine is null" {file: "resource://gre/components/nsSearchService.js" line: 3527}]\' when calling method: [nsIBrowserSearchService::currentEngine]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: resource://app/components/nsBrowserGlue.js :: <TOP_LEVEL> :: line 354"  data: yes]\r\n************************************************************\r\n'

Does anyone know what this means, or what I can do to remedy the error and get the code to run as expected? I've found related error messages through Google searches, but nothing that has allowed me to resolve the issue.

For what it's worth, I can open a Chrome Webdriver without issue by changing the second line of the above to driver = webdriver.Chrome().

I'm using Python 2.7, Selenium 2.35.0 (I just ran "pip install selenium --upgrade) and Firefox 26.0 on a Windows 8 machine. Any tips or advice others can offer are most appreciated.

解决方案

Selenium 2.35 is not compatible with Firefox 26. As the release notes say, FF 26 support was added in Selenium 2.39. You need to update to 2.39. Try pip install -U selenium instead.

这篇关于Python的:硒Firefox的Webdriver失败,错误:'无法加载配置文件... WARN addons.xpi ...&quot;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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