python中的Selenium错误:WebDriverException:未知错误:由于选项卡崩溃导致页面崩溃而删除了会话

时间:2016-10-08 19:03:16

标签: python selenium ubuntu webdriver

我尝试使用selenium webdriver远程服务器上的python 3.5.2ubuntu 16.04连接到网页

from pyvirtualdisplay import Display
from selenium import webdriver

display = Display(visible=0, size=(800, 800))  
display.start()
driver = webdriver.Chrome()
driver.get('https://www.youtube.com/')

我使用the tutorialselenium webdriver上安装ChromeUbuntu 16.04 错误如下所示:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dev/txvenv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 248, in get
    self.execute(Command.GET, {'url': url})
  File "/home/dev/txvenv/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "/home/dev/txvenv/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: session deleted because of page crash
from tab crashed
  (Session info: chrome=53.0.2785.143)
  (Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Linux 4.4.0-36-generic x86_64)

1 个答案:

答案 0 :(得分:0)

共享内存大小问题 设置

卷:       -/ dev / shm:/ dev / shm

this answer save me