【发布时间】: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