selenium 使用遇到的问题

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome failed to start: was killed.
(session not created: DevToolsActivePort file doesn't exist)

1. ChromeDriver 版本与 Chrome 浏览器版本不匹配

2. headless=old,改成headless就正常了  -- 这个是我遇到的

chrome_options.add_argument("--headless")  # 启用无头模式