본문 바로가기

Data handling/Web crawling

DevToolsActivePort file doesn't exist error 해결법

728x90

크롤링 에러 간단하게 해결하는 방법.

에러

WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: 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.)

해결법

크롬 옵션 추가 ( headless, no-sandbox  필수)

from selenium import webdriver

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument("--single-process")
chrome_options.add_argument("--disable-dev-shm-usage")
path='/home/sadf/chromedriver'
driver = webdriver.Chrome(path, chrome_options=chrome_options)

ref)

synkc.tistory.com/entry/Chromedriver-DevToolsActivePort-file-doesnt-exist-%EC%97%90%EB%9F%AC-%ED%95%B4%EA%B2%B0%EB%B2%95

 

Chromedriver DevToolsActivePort file doesn't exist 에러 해결법

간밤에 삽질하게 만들었다. chromedriver가 업데이트 되면서 DevToolsActivePort를 찾을 수 없다는 에러를 뿜게 되었다. chrome_options = webdriver.ChromeOptions() chrome_options.add_argument('--headless'..

synkc.tistory.com