반응형
Selenium 용 Chrome 드라이버를 사용하는 데 문제가 있습니다. chromedriver를 다운로드하여 C : \ Chrome에 저장했습니다.
driver = webdriver.Chrome(executable_path="C:/Chrome/")
그것을 사용하면 다음과 같은 오류가 발생합니다.
Traceback (most recent call last):
File "C:\Python33\lib\subprocess.py", line 1105, in _execute_child
startupinfo)
PermissionError: [WinError 5] Access is denied
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python33\lib\site-packages\selenium\webdriver\chrome\service.py", line 63, in start
self.service_args, env=env, stdout=PIPE, stderr=PIPE)
File "C:\Python33\lib\subprocess.py", line 817, in __init__
restore_signals, start_new_session)
File "C:\Python33\lib\subprocess.py", line 1111, in _execute_child
raise WindowsError(*e.args)
PermissionError: [WinError 5] Access is denied
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Wilson/Dropbox/xxx.py", line 71, in <module>
driver = webdriver.Chrome(executable_path="C:/Chrome/")
File "C:\Python33\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 59, in __init__
self.service.start()
File "C:\Python33\lib\site-packages\selenium\webdriver\chrome\service.py", line 68, in start
and read up at http://code.google.com/p/selenium/wiki/ChromeDriver")
selenium.common.exceptions.WebDriverException: Message: 'ChromeDriver executable needs to be available in the path. Please download from http://chromedriver.storage.googleapis.com/index.html
어떤 도움을 주시면 감사하겠습니다.
해결 방법
실행 파일이 포함 된 디렉터리 경로가 아닌 실행 파일 경로를 지정해야합니다.
driver = webdriver.Chrome(executable_path=r"C:\Chrome\chromedriver.exe")
참조 페이지 https://stackoverflow.com/questions/22130109
반응형
'파이썬' 카테고리의 다른 글
파이썬 numpy 배열 열에서 최대 값을 찾는 방법은 무엇입니까? (0) | 2020.12.21 |
---|---|
파이썬으로 gensim의 word2vec 모델을 사용하여 문장 유사성을 계산하는 방법 (0) | 2020.12.21 |
파이썬 _csv.Error : 반복자는 바이트가 아닌 문자열을 반환해야합니다 (텍스트 모드에서 파일을 열었습니까?). (0) | 2020.12.21 |
파이썬 Python 인터프리터를 종료하지 않고 오류 문을 던지고 Python 함수를 종료하는 방법 (0) | 2020.12.21 |
파이썬 명령 줄 (터미널)에서 Pycharm 실행 (0) | 2020.12.21 |
댓글