본문 바로가기

ERROR12

WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. 파이썬으로 트위터 API 없이 크롤링을 하기위해 구동할 웹브라우저 크롬 드라이버의 위치를 불러오던 중 오류가 발생 입력했던 코드 driver = webdriver.Chrome('C:/Users/user/Downloads/chromedriver_win32/chromedriver.exe') 오류 메시지 'chromedriver.exe' executable needs to be in PATH. 경로 설정에서 상대경로가 아닌 절대경로로 변경하여 오류를 해결하였다 (r'절대경로/파일이름.exe') driver = webdriver.Chrome(r'C:/Users/username/Downloads/chromedriver_win32/chromedriver.exe') 참고 링크 https://emessell.tisto.. 2021. 7. 12.
ModuleNotFoundError: No module named 'pymongo' pymongo 모듈을 import했을 때 발생한 오류. 알고보니 cmd로 pymongo를 설치한 곳과 코드를 실행시킨 가상환경이 서로 달라서 생긴 문제 해결 : 직접 해당 프로젝트의 python interpreter에 들어가서 pymongo 모듈을 설치해주었다 모듈이 정상적으로 불려졌으며 코드를 잘 실행시킬 수 있었다. 2021. 7. 4.
NotImplementedError: Only the following pseudo-classes are implemented: nth-of-type https://mjdeeplearning.tistory.com/46 Python 크롤링 시 Only the following pseudo-classes are implemented: nth-of-type.오류 Only the following pseudo-classes are implemented: nth-of-type.selenium 구글 크롬 개발자도구에서 셀렉터 카피에서 나오는 child 선택자인 nth-child 를 지원하지 않는다. tr:nth ->nth-of-type 으로 바꿔준.. mjdeeplearning.tistory.com 구글 크롬 개발자도구에서 셀렉터 카피에서 나오는 child 선택자인 nth-child 를 지원하지 않는다. tr:nth 을 nth-of-type 으로 바꿔준다. 변경.. 2021. 7. 4.
Max retries exceeded with URL in requests 오류 해결 # 네이버 영화 웹 페이지에서 영화 제목 목록을 가져오는 코드 import requests from bs4 import BeautifulSoup headers = {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36'} data = requests.get('https://movie.naver.com/movie/sdb/rank/rmovie.nhn?sel=pnt&date=20200303',headers=headers) soup = BeautifulSoup(data.text, 'html.parser') trs = soup.selec.. 2021. 7. 4.