您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

selenium.common.exceptions.WebDriverException:消息:未知错误:Chrome无法启动:使用Python中的ChromeDriver和Selenium崩溃

selenium.common.exceptions.WebDriverException:消息:未知错误:Chrome无法启动:使用Python中的ChromeDriver和Selenium崩溃

Chrome在启动过程中崩溃的常见原因是 在Linux上以 用户( )的身份运行Chrome 。虽然可以--no- sand@R_716_2419@在创建WebDriver会话时通过传递标志来解决此问题,但这种配置不受支持,因此不建议使用。您需要配置您的环境以改为以普通用户身份运行Chrome。

根据您的 代码试用 ,您似乎正在尝试访问 Chrome配置文件 因此可以使用以下解决方案:

代码块:

from selenium import webdriver

from selenium.webdriver.chrome.options import Options

options = Options() options.add_argument(“user-data-dir=C:\path\to\your\profile\Google\Chrome\User Data\Profile 2”) driver = webdriver.Chrome(executable_path=r’C:\path\to\chromedriver.exe’, chrome_options=options) driver.get(“https://www.google.co.in")

python 2022/1/1 18:43:46 有308人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶