selenium.common.exceptions.WebDr

2020-06-22  本文已影响0人  mutang

问题:

        chrome_options = webdriver.ChromeOptions()
        chrome_options.add_argument("--mute-audio")  # 静音
        chrome_options.binary_location = "D:\Google\Chrome\Application\chromedriver.exe"
        dr = webdriver.Chrome(options=chrome_options)
        dr.maximize_window()

报错:

raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: was killed.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location D:\Google\Chrome\Application\chromedriver.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

解决:

        chrome_options = webdriver.ChromeOptions()
        chrome_options.add_argument("--mute-audio")  # 静音
        dr = webdriver.Chrome("D:\Google\Chrome\Application\chromedriver.exe",options=chrome_options)
        dr.maximize_window()
上一篇下一篇

猜你喜欢

热点阅读