【发布时间】:2021-09-04 15:41:33
【问题描述】:
所以我正在尝试提交一个表单,但有些东西阻止我访问该框,或者我使用了错误的元素,但我认为我使用了正确的元素。
这是我的代码:
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome(executable_path = 'mypath/chromedriver.exe')
driver.maximize_window()
#driver.implicitly_wait(50)
driver.get("https://ai.fmcsa.dot.gov/SMS")
wait = WebDriverWait(driver, 20)
wait.until(EC.element_to_be_clickable((By.XPATH, "//a[@title='Close']"))).click()
wait = WebDriverWait(driver, 20)
driver.find_element_by_xpath('//*[@id="home-body"]/div[1]/div/div[1]/form/label').click()
driver.find_element_by_xpath('//*[@id="home-body"]/div[1]/div/div[1]/form/label').send_keys('1818437')
driver.find_element_by_xpath('/html/body/div[3]/div[2]/article/section[2]/div[1]/div/div[1]/form/input[2]').click();
我得到的输出是
ElementClickInterceptedException:消息:元素点击被拦截: 元素...是 在点 (553, 728) 不可点击。其他元素将收到 点击:
(会话信息:chrome=93.0.4577.63)
可能是什么问题?
【问题讨论】: