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

home2 게시판 Python, SQL 게시판 인스타 크롤링 몇개월 전에는 잘 됬는데 이번에는 안되네요.

인스타 크롤링 몇개월 전에는 잘 됬는데 이번에는 안되네요.

6 글 보임 - 1 에서 6 까지 (총 6 중에서)
  • 글쓴이
  • #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
    
    
    
    
    
    
     
    #113220

    codingapple
    키 마스터
    selenium 지웠다가 pip install selenium으로 최신버전 설치해보고 
    driver = webdriver.Chrome() 로 바꿔봅시다
    
    #113261

    조승엽
    참가자
    이미 해본거지만 다시 해봐도 안되더라고요. 
    현재 사용중인 크롬 버전을 기존 121.0.6167.161 에서 업데이트해서 버전 121.0.6167.185(공식 빌드) (64비트)로 변경한 상태고요.
    이전에도 그랬지만 아래에서 가장 가까운 버전은 x 라서 stable을 받았었는데 혹시 여기서 받는게 아닌가요? 
    https://googlechromelabs.github.io/chrome-for-testing/
    
    제목 없음
    #113291

    조승엽
    참가자
    파이썬 재설치도 했는데 똑같이 나오네요. 해당 폴더에 있는 chromedriver를 한번 더블클릭해서 실행해보니 아래처럼 뜨는데
    혹시 저게 문제인가 싶어서 올려봐요.
    제목 없음1
    
    
    		
    	
    #113300

    codingapple
    키 마스터
    사진에서 추가정보눌러서 실행눌러봅시다
    근데 셀레니움 4.6 이상버전은 크롬드라이버 다운로드 필요없이 잘 됩니다 
    c드라이브에 한글말고 영어폴더안에 파일만들어서 해봅시다
    #113310

    조승엽
    참가자
    작동되네요. 감사합니다.
6 글 보임 - 1 에서 6 까지 (총 6 중에서)
  • 답변은 로그인 후 가능합니다.

About

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

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

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