centos7 Chrome failed to start: exited abnormally错误解决方法

禁用sandbox

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument(‘–headless’)
options.add_argument(‘–disable-gpu’)
options.add_argument(‘–no-sandbox’)
driver = webdriver.Chrome(executable_path=”/root/test/chromedriver”, chrome_options=options)
driver.get(“https://www.baidu.com“)
print(driver.page_source)
driver.quit()

你可能感兴趣的:(python)