본문 바로가기

분류 전체보기718

또다시 selenium 에러.. 아... 진짜 어이가 없다. StaleElementReferenceException: Message: stale element reference: element is not attached to the page document 에러가 뜨길래 검색해보니, 보통 접근시간이 너무 빠르기 때문에 time.sleep 을 걸어주는 것을 추천했다. 하지만 내가 반복문에도 도입을 해보고 이리해보고 저리해봐도 똑같은 에러가 나더라. 상황적으로는 특정 페이지의 값을 크롤링 해와야하는데, 해당 크롤링값은 25개 정도였다. # 정상 작동된 코드 gu_list_raw = driver.find_element_by_id('SIGUNGU_NM0') gu_list = gu_list_raw.find_elements_by_tag_name.. 2022. 6. 8.
Beautifulsoup 재수강 시작 (attribute error) 아무래도 내가 구글링해서 할수도 있겠지만, 근본적으로 아직 그 영역에는 15%정도 못미친다고 생각해서 제로베이스의 강의를 다시 들으려고 했다. 시작부터 안되는게 있었다. "아니 난 분명히 잘 따라했는데 왜안되는거야" 위에서 보듯이 문명히 p 태그에 inner-texst first-item이라는 클래스면서 id값이 first인게 있었다. 근데 이게 조회가 안되는거다; .text로 붙여서 해주든, print로 감싸서 진행을 해주든 작동이 안되는거다; 하... 진짜 왜 None값으로 나오는거야... 하면서 고민에 고민을 했다. 그러다가 겨우 발견했다. 첫번째 사진을 자세히보면 "' "이렇게 되어있다. 즉, 홀따운표가 하나더 들어간 것이다; 하... 아무튼 이걸 깨닫고 지워줬다. 그리고 작동이 잘되기를 바랬는데.. 2022. 6. 7.
파이썬 beautifulsoup, selenium (ft. 아직 안끝났지만 이미 어이가 없다;) - 진행중 (해결 x) 파이썬 beautifulsoup, selenium 을 이용한 크롤링 과제 진행 중이다. (해결 x) 다른것보다 어처구니가 없는건 분명 있는데 없다고 하는것과 없는데 작동이 되는거다.;; 오늘의 경우에는 명확히 없는데 작동되는 경우를 올려보고자 한다. from bs4 import BeautifulSoup from selenium import webdriver import time driver = webdriver.Chrome('../driver/chromedriver.exe') driver.get('https://www.starbucks.co.kr/store/store_map.do') loca_search = driver.find_element_by_class_name('loca_search') loca_.. 2022. 6. 7.
WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home 에러 WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home ChromeDriver - WebDriver for Chrome WebDriver is an open source tool for automated testing of webapps across many browsers. It provides capabilities for navigating to web pages, user input, JavaScript execution, and more. ChromeDriver is a standalone server that imple.. 2022. 6. 6.