웹 크롤링 중 find_element 메서드를 이용해서 값이 찾아지지 않는다면, 아마 iframe이라는 태그가 존재해서일 것이다.
iframe은 하나의 프레임을 만드는 태그인데, 쉽게 말하면 html 안에 따로 html을 담는 프레임이다.
따라서 프레임을 한 번 바꿔준 후에 find_element를 해줘야 한다.
driver.find_element_by_id("searchIframe") #iframe 태그 엘리먼트 찾기
driver.switch_to.frame(element) #프레임 이동
driver.find_element(By.XPATH, '//*[@id="_pcmap_list_scroll_container"]/ul')
'Programming > Errors' 카테고리의 다른 글
[Python] BeautifulSoup을 이용한 크롤링에서 한글 깨짐 해결 (0) | 2022.06.17 |
---|---|
[Mysql, Node.js] M1 맥북 Mysql Node.js 연동 오류 ECONNREFUSED 오류 (0) | 2022.06.10 |
[Linux] ubuntu-desktop 설치 시 dependencies 오류 - unmet dependencies (0) | 2022.06.10 |
[JAVA] 백준 자바 서식, 제출방법 (0) | 2021.10.13 |
[오류 해결] 맥북에서 pyautogui.locateonscreen 안 될 때 (0) | 2021.09.30 |
댓글