100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.36.540471

unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.36.540471

时间:2019-07-16 12:26:23

相关推荐

unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.36.540471

问题描述:用python写了个爬虫,pycharm中运行正常,linux下命令行运行报错

Message: unknown error: Chrome failed to start: exited abnormally(Driver info: chromedriver=2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752),platform=Linux 4.14.0-deepin2-amd64 x86_64)

google解决方案:/forum/#!topic/qaf-users/ZRUbGWSL7Y8

You are using arg --headless so with that my be you can try with another argument --no-sandbox and window-size=1024,768.chrome.additional.capabilities={"chromeOptions":{"args":["--headless", "window-size=1024,768", "--no-sandbox"], "binary": "/home/ubuntu/software/chromedriver"}}You can refer following/questions/22558077/unknown-error-chrome-failed-to-start-exited-abnormally-driver-info-chromedri/SeleniumHQ/selenium/issues/4961

按照上面给出的解决方案把代码修改如下:

chrome_options = Options()chrome_options.add_argument('--headless')chrome_options.add_argument('--disable-gpu')chrome_options.add_argument("window-size=1024,768")chrome_options.add_argument("--no-sandbox")driver = webdriver.Chrome(chrome_options=chrome_options)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。