简体   繁体   English

使用 GeckoDriver 和 Firefox 到 Selenium 的“无法获取区域”(新错误(“NO_RESULT”、“resource://gre/modules/Region.jsm”、376))错误

[英]“Failed to fetch region” (new Error(“NO_RESULT”, “resource://gre/modules/Region.jsm”, 376)) error using GeckoDriver and Firefox through Selenium

This code works on an English Windows username, but does not on a non-english username此代码适用于英语 Windows 用户名,但不适用于非英语用户名

from seleniumwire import webdriver  # Import from seleniumwire
from selenium.webdriver.firefox.options import Options as FirefoxOptions
options = FirefoxOptions()

firefox_profile = webdriver.FirefoxProfile(r'D:\yt\tempProfile')
url = "https://www.google.com/"
try:
    driver = webdriver.Firefox(firefox_profile=firefox_profile,options=options)
    print("path=",str(driver.firefox_profile.path))
    driver.get(url)    
finally:
    if 'driver'  in locals():
        driver.quit()
    else:
        print("driver is none")

I think having a non-english Windows username creates a problem with running geckodriver.我认为使用非英语 Windows 用户名会导致运行 geckodriver 出现问题。

geckodriver.log:壁虎驱动程序日志:

1607996979444   geckodriver INFO    Listening on 127.0.0.1:50416
1607996984556   mozrunner::runner   INFO    Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\88D7~1\\AppData\\Local\\Temp\\rust_mozprofile64HlEP"
1607996985346   Marionette  INFO    Listening on port 50424
1607996985603   Marionette  WARN    TLS certificate errors will be ignored for this session
1607996985604   Marionette  INFO    Proxy settings initialised: {"proxyType":"manual","httpProxy":"127.0.0.1:50414","noProxy":[],"sslProxy":"127.0.0.1:50414"}
1607996986131   Marionette  INFO    Stopped listening on port 50424
console.error: Region.jsm: "Error fetching region" (new TypeError("NetworkError when attempting to fetch resource.", ""))
console.error: Region.jsm: "Failed to fetch region" (new Error("NO_RESULT", "resource://gre/modules/Region.jsm", 376))

###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost


###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv

its trying to run a profile from temp folder inside appdata.它试图从 appdata 中的临时文件夹运行配置文件。

Is there a way to tell geckodriver to use a different temp folder?有没有办法告诉 geckodriver 使用不同的临时文件夹?

This error message...此错误消息...

console.error: Region.jsm: "Error fetching region" (new TypeError("NetworkError when attempting to fetch resource.", ""))
console.error: Region.jsm: "Failed to fetch region" (new Error("NO_RESULT", "resource://gre/modules/Region.jsm", 376))

...implies that the Firefox was unable to trigger the downloading of region maps within the new Browsing Context ie Firefox Browser session as you are handling a non-english username. ...意味着Firefox无法在新的浏览上下文中触发区域地图的下载,即Firefox 浏览器session 在您处理非英语用户名时。


Trigger download of map map的触发器下载

Trigger download of map was a known issue with which got addressed through changeset and should be available with Firefox 79 with the Mozilla Preference enabled.map 的触发下载是的一个已知问题,该问题已通过变更集得到解决,并且应该在启用Mozilla 偏好设置Firefox 79中可用。


Solution解决方案

Ensure that:确保这件事:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AttributeError: 'Options' object has no attribute 'binary' error invoking Headless Firefox using GeckoDriver through Selenium - AttributeError: 'Options' object has no attribute 'binary' error invoking Headless Firefox using GeckoDriver through Selenium 类型错误:get() 缺少 1 个必需的位置参数:使用 GeckoDriver 和 Firefox 到 Selenium 和 Python 时出现“url”错误 - TypeError: get() missing 1 required positional argument: 'url' error using GeckoDriver and Firefox through Selenium and Python OSError: [WinError 193] %1 is not a valid Win32 application error using GeckoDriver and Firefox through Selenium and Python on Windows - OSError: [WinError 193] %1 is not a valid Win32 application error using GeckoDriver and Firefox through Selenium and Python on Windows 使用GeckoDriver和Python的Selenium firefox webdriver未知错误 - Selenium firefox webdriver unknown error using GeckoDriver and Python 'geckodriver' 可执行文件需要在 PATH 中使用 GeckoDriver 和 Firefox 到 Selenium - 'geckodriver' executable needs to be in PATH using GeckoDriver and Firefox through Selenium 通过geckodriver的Selenium Firefox Webdriver导致错误:无法启动浏览器:找不到实体 - Selenium Firefox webdriver via geckodriver results in error: Failed to start browser: entity not found Selenium中的“ driver = webdriver.Firefox()”出现“ WebDriverException:'geckodriver'可执行文件必须在PATH中”错误 - “WebDriverException: 'geckodriver' executable needs to be in PATH” error while 'driver = webdriver.Firefox()' through Selenium InvalidArgumentException:消息:二进制不是使用 GeckoDriver Firefox Selenium 和 Python 的 Firefox 可执行文件错误 - InvalidArgumentException: Message: binary is not a Firefox executable error using GeckoDriver Firefox Selenium and Python 消息:错误:轮询更改失败:在通过 Selenium 和 FirefoxProfile 下载文件时尝试获取资源时出现网络错误 - Message: Error: Polling for changes failed: NetworkError when attempting to fetch resource while downloading file through Selenium and FirefoxProfile 使用 GeckoDriver Firefox 到 Selenium 已丢弃浏览上下文 - Browsing context has been discarded using GeckoDriver Firefox through Selenium
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM