Selenium: WebDriverException:Chrome failed to start: crashed as google-chrome is no longer running so ChromeDriver is assuming that Chrome has crashed

后端 未结 14 2043
走了就别回头了
走了就别回头了 2020-11-21 23:05

Recently I switched computers and since then I can\'t launch chrome with selenium. I\'ve also tried Firefox but the browser instance just doesn\'t launch.

f         


        
14条回答
  •  庸人自扰
    2020-11-21 23:34

    Try to download HERE and use this latest chrome driver version.

    https://sites.google.com/a/chromium.org/chromedriver/downloads

    EDIT:

    Try this:

    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options
    
    chrome_options = Options()
    chrome_options.add_argument('--headless')
    chrome_options.add_argument('--no-sandbox')
    chrome_options.add_argument('--disable-dev-shm-usage')
    d = webdriver.Chrome('/home/PycharmProjects/chromedriver',chrome_options=chrome_options)
    d.get('https://www.google.nl/')
    

提交回复
热议问题