首页 > 解决方案 > Selenium 超时从 python 上的渲染器接收消息

问题描述

在 Chrome 发布他们最新的稳定版本 (89.0.4389.90) 之后,我现在收到这个错误:

selenium.common.exceptions.TimeoutException:消息:超时:从渲染器接收消息超时:291.642(会话信息:无头 chrome=89.0.4389.90)

我的 Python 代码是

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.headless = True
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')  # maybe needed if running on Windows.
options.add_argument("--disable-dev-shm-usage")
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome('/usr/local/bin/chromedriver', options=options)
urls = "https://www.google.com/"
driver.get(urls) #here I have the error

(我的 chromedriver 是 89.0.4389.23 是 unic)

有人可以帮我解决这个问题吗?

标签: python-3.xseleniumselenium-webdriverweb-scraping

解决方案


我会参考上一篇文章,您可能会在其中找到一些有用的解决方法:Chrome Webdriver 在 Selenium 中产生超时


推荐阅读