DataScience
728x90
 

잘 되던 셀레니움 크롬드라이버가 갑자기 permission 에러가 발생합니다.

chrome_options = Options()
chrome_options.add_argument('headless')
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()),options=chrome_options)

PermissionError: [Errno 13] Permission denied: 'C:\\Users\\ninestar\\.wdm\\drivers\\chromedriver\\win64\\120.0.6099.109\\chromedriver-win32\\chromedriver.exe'

 

 

 

stackoverflow에서 해결방법을 찾았습니다. 

 

어떤 버전의 셀레늄을 사용 중인지 잘 모르겠습니다. 최신 버전인 셀레늄 v4.6.0 이상을 사용 중이라면 브라우저 드라이버를 처리하기 위해 WebDriverManager와 같은 타사 라이브러리를 사용할 필요가 없습니다. 다음과 같이 코드를 간소화할 수 있습니다:

chrome_options = Options()
chrome_options.add_argument('headless')
driver = webdriver.Chrome(options=chrome_options)

 

webdriver.Chrome함수에 service arg를 빼니 실행이 잘 됩니다. 

 

 

출처:

https://stackoverflow.com/questions/76727774/selenium-webdriver-chrome-115-stopped-working

 

 

Selenium WebDriver Chrome 115 stopped working

I have Chrome 115.0.5790.99 installed on Windows, and I use Selenium 4.10.0. In my Python code, I call service = Service(ChromeDriverManager().install()) and it returns the error: ValueError: Ther...

stackoverflow.com

 

profile

DataScience

@Ninestar

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!