selenium 에서 element를 찾을 수 없다고 나옵니다.
조회수 5130회
Ie webdriver를 이용하여 selenium 작업시 에러
에러 메세지
selenium.common.exceptions.NoSuchElementException: Message: Unable to find element with xpath == //li/a[@id='a_0111060000']
또는 다른 에러들 줄줄..
윈도우10 , 파이썬 3 ( in anaconda) 환경이며
IE 브라우저를 사용해야 합니다
작업 순서 :
http://www.hometax.go.kr 에 접속하여,
조회/발급 메뉴를 클릭하고,
근로소득간이세액표를 클릭하는 것 까지의 활동입니다.
제 코드는 이렇습니다.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoSuchElementException
import os
import time
driver = webdriver.Ie()
driver.get("http://www.hometax.go.kr")
driver.find_element_by_xpath("//li[@id='group1299']").click()
time.sleep(2)
driver.switch_to_frame(driver.find_element_by_tag_name('iframe'))
time.sleep(2)
driver.find_element_by_xpath("//li/a[@id='a_0111060000']").click()
읽어 주셔서 감사합니다. 혹시 가능한 코드를 알려 주시면 정말 감사하겠습니다.
-
(•́ ✖ •̀)
알 수 없는 사용자
1 답변
-
해결 돼서 자답 합니다.
코드에 문제가 있었던 것이 아니라 IE 드라이버가 32비트로 설치돼서 생긴 문제였네요..
내 운영체제에 맞는 64비트 드라이버로 했더니 해결 됐어요.
-
(•́ ✖ •̀)
알 수 없는 사용자
-
댓글 입력