我尝试使用selenium webdriver
远程服务器上的python 3.5.2
和ubuntu 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 tutorial在selenium webdriver
上安装Chrome
和Ubuntu 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)