gpt4 book ai didi

python-3.x - 错误 : no DISPLAY environment variable specified

转载 作者:行者123 更新时间:2023-12-04 09:00:22 27 4
gpt4 key购买 nike

我已经设置了一个 Selenium Grid,在 Ubuntu Server 中设置了一个 Hub,在 Ubuntu Desktop 中设置了一个 Node。在 Node 机器上安装 Geckodriver 和 Firefox。并使用以下python代码。

from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions

options = webdriver.FirefoxOptions()
driver = webdriver.Remote(
command_executor='http://192.168.56.7:4444/wd/hub',
options=options
)
但出现错误 错误:未指定 DISPLAY 环境变量 在 Node 机器上。
添加后工作正常
options.add_argument('--headless')
不想在 headless 模式下运行它。
提前感谢大家。

最佳答案

只需尝试设置环境变量 DISPLAY请。
您的问题与 Selenium Error: no display specified 有点重复

关于python-3.x - 错误 : no DISPLAY environment variable specified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63592708/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com