我在下面遇到问题错误:
陈旧元素参考:元素未附加到页面文档
我必须单击表格形式的值以选择数据并按照以下步骤进行操作。
这些是我的代码,错误行是最后一个。
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome()
driver.implicitly_wait(5)
driver.get("https://tms.samil.com/ProjectMonitoring/ProjectActivityDetail")
driver.find_element_by_xpath("//*[@id='searchHeadDiv']/button").click()
driver.find_element_by_xpath("//*[@id='projectSearch']/div/div[1]/form/div[2]/a").click()
driver.find_element_by_xpath("//*[@id='projectSearch']/div/div[1]/form/div[2]/div/div/div/ul/li[2]/a").click()
project_code_input = driver.find_element_by_xpath("//*[@id='projectSearch']/div/div[1]/form/input")
project_list = '00575-01-011'
project_code_input.send_keys(project_list)
project_code_input.send_keys(Keys.ENTER)
driver.find_element_by_xpath("//*[@id='projectSearchGrid']/div[2]/table/tbody/tr[2]/td[2]").click()