• 로그인
  • 장바구니에 상품이 없습니다.

home2 게시판 Python, SQL 게시판 chrome driver 문제...

chrome driver 문제...

4 글 보임 - 1 에서 4 까지 (총 4 중에서)
  • 글쓴이
  • #114907

    김상원
    참가자
    제 chrome version은 122.0.6261.95에요.
    근데 chrome driver download web에는 122.0.6261.94밖에 없더라구요.
    그래서 이거라도 다운 받고 압축 풀기를 통해 chromedriver.exe, Lisence.chromedriver를 얻었어요. 이 두 파일을 파이썬 파일 디렉토리 내에 넣었어요. 그런데
    raceback (most recent call last):
      File "C:\Users\user\AppData\Roaming\Python\Python311\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:\Users\user\AppData\Roaming\Python\Python311\site-packages\selenium\webdriver\common\selenium_manager.py", line 90, in driver_location
        output = self.run(args)
                 ^^^^^^^^^^^^^^
      File "C:\Users\user\AppData\Roaming\Python\Python311\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:\Users\user\AppData\Roaming\Python\Python311\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 "c:\Users\user\Desktop\�ڵ�����\��ũ�Ѹ�\insta\app.py", line 6, in <module>
        driver = webdriver.Chrome()
                 ^^^^^^^^^^^^^^^^^^
      File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\selenium\webdriver\chrome\webdriver.py", line 45, in __init__
        super().__init__(
      File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\selenium\webdriver\chromium\webdriver.py", line 51, in __init__
        self.service.path = DriverFinder.get_path(self.service, options)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\user\AppData\Roaming\Python\Python311\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
    이렇게 뜹니다.
    뭐가 문제인가요..어떻게 해결하나요..
    #114915

    codingapple
    키 마스터
    webdriver.Chrome() 에 경로없이 써봅시다
    #114927

    김상원
    참가자
    from selenium import webdriver
    from selenium.webdriver.common.keys import Keys
    import time
    driver = webdriver.Chrome()
    driver.get("https://instagram.com")
    #driver안에 주소에 담긴 글,이미지가 모두 담겨 있음.
    time.sleep(2)
    #맞게 입력하고 불렀는데 element가 없다고 뜨면, 페이지 로딩 시간 때문에 그럼. 페이지 로딩하는데 시간이 1~2초 걸리는데, 이때 데이터를 가져오려고 해서 에러 뜨는거
    #위 문제에 경우, time.sleep()으로 delay를 걸면 로딩 시간 지연에 따른 문제가 해결.
    e = driver.find_element_by_css_selector("input[name='username']")
    e.send_keys("내아이디")
    e.send_keys(Keys.ENTER)
    time.sleep(100)
    
    이미 그렇게 했는데 안 되는거라..! 어떻게 해야 될까요
    #114959

    codingapple
    키 마스터
    pip install selenium 으로 최신버전으로 설치해서 실행해봅시다
4 글 보임 - 1 에서 4 까지 (총 4 중에서)
  • 답변은 로그인 후 가능합니다.

About

현재 월 700명 신규수강중입니다.

  (09:00~20:00) 빠른 상담은 카톡 플러스친구 코딩애플 (링크)
  admin@codingapple.com
  이용약관
ⓒ Codingapple, 강의 예제, 영상 복제 금지
top

© Codingapple, All rights reserved. 슈퍼로켓 에듀케이션 / 서울특별시 강동구 고덕로 19길 30 / 사업자등록번호 : 212-26-14752 온라인 교육학원업 / 통신판매업신고번호 : 제 2017-서울강동-0002 호 / 개인정보관리자 : 박종흠