It says that element cannot be found in selenium.

Asked 2 years ago, Updated 2 years ago, 44 views

selenium.common.exceptions.NoSuchElementException: Message: Unable to find element with xpath == //li/a[@id='a_0111060000']

Or other errors.

Windows 10, Python 3 (in anaconda) environment

You must use the IE browser

Go to http://www.hometax.go.kr, and

Click the Inquiry/Issue menu, and

It's an activity up to clicking on the earned income summary tax table.

Here's my code.

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()

Thank you for reading. I would really appreciate it if you could let me know the available code.

python selenium

2022-09-21 17:36

1 Answers

It's not that there was a problem with the code It was caused by the installation of the IE driver with 32 bits.

I tried a 64-bit driver that fits my operating system and it worked out.


2022-09-21 17:36

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.