6 글 보임 - 1 에서 6 까지 (총 6 중에서)
-
글쓴이글
-
2024년 2월 14일 11:40 #113201
조승엽참가자selenium 버전 4.11.2 현재 사용중인 크롬 버전 121.0.6167.161 크롬드라이브 121.0.6167.85 - win 32, win 64 둘다 해봤고요. from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By import time import urllib.request
# driver = webdriver.Chrome() driver = webdriver.Chrome('chromedriver.exe') driver.get('https://www.instagram.com/')
를 쓰면 아래 같은 에러 코드가 나오고
PS E:\파이썬기초코딩애플-instagram-re> python app.py Traceback (most recent call last): File "C:\Python3.9\lib\site-packages\selenium\webdriver\common\driver_finder.py", line 38, in get_path path = SeleniumManager().driver_location(options) if path is None else path File "C:\Python3.9\lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 71, in driver_location browser = options.capabilities["browserName"] AttributeError: 'str' object has no attribute 'capabilities'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "E:\파이썬기초코딩애플-instagram-re\app.py", line 8, in <module> driver = webdriver.Chrome('chromedriver.exe') File "C:\Python3.9\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 45, in __init__ super().__init__( File "C:\Python3.9\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 51, in __init__ self.service.path = DriverFinder.get_path(self.service, options) File "C:\Python3.9\lib\site-packages\selenium\webdriver\common\driver_finder.py", line 40, in get_path msg = f"Unable to obtain driver for {options.capabilities['browserName']} using Selenium Manager." AttributeError: 'str' object has no attribute 'capabilities' ===============================
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By import time import urllib.request
driver = webdriver.Chrome() # driver = webdriver.Chrome('chromedriver.exe') driver.get('https://www.instagram.com/') 로 빈칸으로 두면 아래처럼 뜨네요.
PS E:\파이썬기초코딩애플-instagram-re> python app.py Traceback (most recent call last): File "C:\Python3.9\lib\site-packages\selenium\webdriver\common\driver_finder.py", line 38, in get_path path = SeleniumManager().driver_location(options) if path is None else path File "C:\Python3.9\lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 90, in driver_location output = self.run(args) File "C:\Python3.9\lib\site-packages\selenium\webdriver\common\selenium_manager.py", line 138, in run raise WebDriverException(f"Unsuccessful command executed: {command}.\n{result}{stderr}") selenium.common.exceptions.WebDriverException: Message: Unsuccessful command executed: C:\Python3.9\lib\site-packages\selenium\webdriver\common\windows\selenium-manager.exe --browser chrome --output json. {'code': 69, 'message': 'Driver unavailable: Driver path: ', 'driver_path': '', 'browser_path': ''}
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "E:\파이썬기초코딩애플-instagram-re\app.py", line 7, in <module> driver = webdriver.Chrome() File "C:\Python3.9\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 45, in __init__ super().__init__( File "C:\Python3.9\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 51, in __init__ self.service.path = DriverFinder.get_path(self.service, options) File "C:\Python3.9\lib\site-packages\selenium\webdriver\common\driver_finder.py", line 41, in get_path raise NoSuchDriverException(msg) from err selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location
2024년 2월 14일 14:27 #113220
codingapple키 마스터selenium 지웠다가 pip install selenium으로 최신버전 설치해보고 driver = webdriver.Chrome() 로 바꿔봅시다
2024년 2월 14일 19:06 #113261
조승엽참가자이미 해본거지만 다시 해봐도 안되더라고요. 현재 사용중인 크롬 버전을 기존 121.0.6167.161 에서 업데이트해서 버전 121.0.6167.185(공식 빌드) (64비트)로 변경한 상태고요. 이전에도 그랬지만 아래에서 가장 가까운 버전은 x 라서 stable을 받았었는데 혹시 여기서 받는게 아닌가요? https://googlechromelabs.github.io/chrome-for-testing/
2024년 2월 14일 23:52 #113291
조승엽참가자파이썬 재설치도 했는데 똑같이 나오네요. 해당 폴더에 있는 chromedriver를 한번 더블클릭해서 실행해보니 아래처럼 뜨는데
혹시 저게 문제인가 싶어서 올려봐요.
2024년 2월 15일 09:33 #113300
codingapple키 마스터사진에서 추가정보눌러서 실행눌러봅시다 근데 셀레니움 4.6 이상버전은 크롬드라이버 다운로드 필요없이 잘 됩니다 c드라이브에 한글말고 영어폴더안에 파일만들어서 해봅시다
-
글쓴이글
6 글 보임 - 1 에서 6 까지 (총 6 중에서)
- 답변은 로그인 후 가능합니다.