selenium grid运行报错

在调试时报了一个很奇怪的错,本地跑selenium代码没问题,但到remote环境上就出了问题,一直报这个错

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x000001F48B424250>
response = {'status': 500, 'value': 'Host header or origin header is specified and is not whitelisted or localhost.'}
>           raise exception_class(value)
E           selenium.common.exceptions.WebDriverException: Message: Host header or origin header is specified and is not whitelisted or localhost.

D:\Pychaem\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py:207: WebDriverException

代码附上


def test_login_er():
    url = "http://192.174.102.2:4444/wd/hub"
    desired_capabilities = {
        "browserName": "chrome",  # 指定运行的浏览器
        "version": "",  # 指定版本
        "platform": "any",  # 指定平台
        "javascriptEnabled": "true"  # 指定是否支持Js脚本
    }
    driver = webdriver.Remote(url, desired_capabilities=desired_capabilities)
    try:

        # 初始化
        driver.maximize_window()
        driver.get('https://www.baidu.com/')
        driver.quit()

    finally:
        pass



网上搜了一下,浏览器驱动版本是没问题的,hub和node服务也起来了(在本地运行的),求解答

你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答


本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。


因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。