본문 바로가기

TIL/개인공부

[Selenium] unknown error: DevToolsActivePort file doesn't exist 문제 해결

목차

    반응형

    다음과같이 webdriver.Chrome에 chrome_options라는 파라미터값을 추가하면 해결된다.

    출처: https://study-grow.tistory.com/entry/DevToolsActivePort-file-doesnt-exist-error-해결법

    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 = #chrome driver 설치위치
    driver = webdriver.Chrome(path, chrome_options = chrome_options)
    반응형