Chrome Pointer

2024年5月7日 星期二

執行(session not created: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)解法

當執行selenium遇見以下錯誤時~

 (session not created: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)


1. 有可能你的chromedriver版本不對

可以去以下網址 或 自行去其他網址找尋相對應的chromedriver

https://getwebdriver.com/chromedriver#stable


2.權限全打開 就可以解決了~~

options = webdriver.ChromeOptions()
options.add_argument("--headless")
options.add_argument("--disable-gpu")
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")


我是參考這篇才找到解法的qq

https://ithelp.ithome.com.tw/m/articles/10342034

1 則留言:

  1. 崴少已經不玩跑online 了嗎?(⁠´⁠;⁠︵⁠;⁠`⁠)

    回覆刪除

喜歡我的文章嗎? 喜歡的話可以留言回應我喔! ^^