解決DevToolsActivePort file doesn't exist

  今天遇到個小問題:selenium 啓動 chrome crash,報錯:DevToolsActivePort file doesn't exist

  在option中添加一下幾行:

 

option = webdriver.ChromeOptions()
option.add_argument('--headless')
option.add_argument('--no-sandbox')  # fix:DevToolsActivePort file doesn't exist
option.add_argument('--disable-gpu')  # fix:DevToolsActivePort file doesn't exist
option.add_argument('--disable-dev-shm-usage')  # fix:DevToolsActivePort file doesn't exist
option.add_argument('--remote-debugging-port=9222')  # fix:DevToolsActivePort file doesn't

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章