【问题标题】:Driver error in Firefox Quantum with Selenium and XUL带有 Selenium 和 XUL 的 Firefox Quantum 中的驱动程序错误
【发布时间】:2017-11-22 16:27:23
【问题描述】:

版本:

  • Ubuntu 16.04
  • Mozilla Firefox 58.0
  • Selenium-3.7.0

示例代码:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from selenium import webdriver

profile = webdriver.FirefoxProfile()
profile.set_preference("browser.privatebrowsing.autostart", True)
driver = webdriver.Firefox(profile)

使用 Python-Selenium 在 Firefox 中出错:

XML read error: entity not defined
Location: chrome://browser/content/browser.xul
Line number 1165, column 7:
      <menuitem class="pageActionContextMenuItem extensionUnpinned"
------^

注意: 如果您在 Ubuntu 12 中使用 FIrefox Quantum,也会出现该错误。

【问题讨论】:

  • 可能是编码问题。请尝试一下。
  • @OlafSzmidt #!/usr/bin/env python and # -- coding: utf-8 -- ??
  • IMO,Firefox Quantum (Released) 版本是 57.0 你使用的是来自 Nightly / Beta / Developers ?
  • @DebanjanB 我正在使用存储库 ppa:mozillateam/firefox-next

标签: python selenium selenium-webdriver selenium-firefoxdriver firefox-quantum


【解决方案1】:

解释:Is selenium IDE an XUL add-on in Firefox?

解决方法,使用旧版本到58的火狐:

sudo apt-get remove --purge firefox
sudo add-apt-repository ppa:ubuntu-mozilla-daily/firefox-aurora
sudo apt-get update
sudo apt-get install firefox=57.0+build4-0ubuntu0.16.04.5

感谢@DebanjanB

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-09-09
    • 2018-10-20
    • 2016-04-04
    • 2016-10-16
    • 2022-01-28
    • 2014-11-05
    • 2013-04-25
    • 1970-01-01
    相关资源
    最近更新 更多