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

home2 게시판 Python, SQL 게시판 셀레니움 실행 시 오류 발생

셀레니움 실행 시 오류 발생

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

    양철웅
    참가자
    안녕하세요 인스타봇 첫번쨰 강의 수강중인데
    
    from selenium import webdriver
    from selenium.webdriver.common.keys import Keys
    driver = webdriver.Chrome('chromedriver.exe')
    driver.get('https://instagram.com')
    실행 시 
    
    Traceback (most recent call last):
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
        self.process = subprocess.Popen(cmd, env=self.env,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1026, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1538, in _execute_child
        hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    FileNotFoundError: [WinError 2] 지정된 파일을 찾을 수 없습니다
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "c:\Users\PC\Desktop\Python Lab\instagram\insta.py", line 5, in <module>
        driver = webdriver.Chrome('chromedriver.exe')
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
        self.service.start()
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
        raise WebDriverException(
    selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
    
    상기 내용으로 오류가 발생되어 진행이 어렵습니다.
    
    피드백 부탁드려요... ㅠㅠ
    
    
    
    #92552

    codingapple
    키 마스터
    chromedriver.exe 파일을 파이썬파일 옆에 두고 
    driver = webdriver.Chrome() 만 써봅시다 
    
    #92757

    양철웅
    참가자
    PS C:\Users\PC\Desktop\Python Lab\instagram> python insta.py
    Traceback (most recent call last):
      File "C:\Users\PC\Desktop\Python Lab\instagram\insta.py", line 5, in <module>
        driver = webdriver.Chrome()
                 ^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__
        RemoteWebDriver.__init__(
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
        self.start_session(capabilities, browser_profile)
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
        response = self.execute(Command.NEW_SESSION, parameters)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 319, in execute
        response = self.command_executor.execute(driver_command, params)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 374, in execute
        return self._request(command_info[0], url, body=data)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 397, in _request
        resp = self._conn.request(method, url, body=body, headers=headers)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\_request_methods.py", line 118, in request
        return self.request_encode_body(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\_request_methods.py", line 217, in request_encode_body
        return self.urlopen(method, url, **extra_kw)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\poolmanager.py", line 432, in urlopen
        conn = self.connection_from_host(u.host, port=u.port, scheme=u.scheme)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\poolmanager.py", line 303, in connection_from_host
        return self.connection_from_context(request_context)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\poolmanager.py", line 328, in connection_from_context
        return self.connection_from_pool_key(pool_key, request_context=request_context)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\poolmanager.py", line 351, in connection_from_pool_key
        pool = self._new_pool(scheme, host, port, request_context=request_context)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\poolmanager.py", line 265, in _new_pool
        return pool_cls(host, port, **request_context)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 196, in __init__
        timeout = Timeout.from_float(timeout)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\timeout.py", line 190, in from_float
        return Timeout(read=timeout, connect=timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\timeout.py", line 119, in __init__
        self._connect = self._validate_timeout(connect, "connect")
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\timeout.py", line 156, in _validate_timeout
        raise ValueError(
    ValueError: Timeout value connect was <object object at 0x000001F5D2004540>, but it must be an int, float or None.
    
    피드백 주신내용으로 반영하여 실행해도 위와 같은 오류값이 나옵니다..ㅠㅠ
    
    20230729224428
    
    #92785

    codingapple
    키 마스터
    pip uninstall selenium
    pip install selenium==4.8.2 터미널에 입력해봅시다
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 호 / 개인정보관리자 : 박종흠