Selenium/Python TimeoutException:超时:从渲染器接收消息时超时

2024-09-29 21:32:57 发布

您现在位置:Python中文网/ 问答频道 /正文

from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument('--headless')
options.add_argument('--incognito')
options.add_argument("start-maximized")
options.add_experimental_option("prefs", {"profile.managed_default_content_settings.images": 2})
options.add_argument("--no-sandbox") 
options.add_argument("--disable-setuid-sandbox") 
options.add_argument("--remote-debugging-port=9222")
options.add_argument("--disable-dev-shm-using") 
options.add_argument("--disable-extensions") 
options.add_argument("--disable-gpu") 
options.add_argument("start-maximized") 
options.add_argument("disable-infobars")

driver = webdriver.Chrome(options=options, 
executable_path=r'C:\Users\sgopinath\AppData\Local\Continuum\anaconda3\Scripts\chromedriver.exe')

driver.get("https://www.cmegroup.com/trading/energy/crude-oil/light-sweet-crude_quotes_globex.html? 
optionProductId=769&optionExpiration=769-H1")

ERROR:

Traceback (most recent call last):

File "<ipython-input-7-102cf00a8b86>", line 1, in <module>
driver.get("https://www.cmegroup.com/trading/energy/crude-oil/light-sweet-crude_quotes_globex.html?optionProductId=769&optionExpiration=769-H1")

File "C:\Users\sgopinath\AppData\Local\Continuum\anaconda3\lib\selenium\webdriver\remote\webdriver.py", line 333, in get
self.execute(Command.GET, {'url': url})

File "C:\Users\sgopinath\AppData\Local\Continuum\anaconda3\lib\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)

File "C:\Users\sgopinath\AppData\Local\Continuum\anaconda3\lib\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)

TimeoutException: timeout: Timed out receiving message from renderer: -0.000
(Session info: headless chrome=89.0.4389.90)

以下两个网站不存在此问题

driver.get("https://www.ne2.ca/")----->NO ERROR

driver.get("https://www.wsj.com/market-data/quotes/futures/CRUDE%20OIL%20-%20ELECTRONIC/contracts")--->NO ERROR

Tags: addgetremotelocaldriverseleniumargumentusers

热门问题