Selenium Python-消息:单击网页上的多个链接时拦截了元素单击

时间:2020-07-17 23:02:56

标签: python-3.x selenium web-scraping

我试图点击此page上的所有课程链接,但这给了我这个错误:

Message: element click intercepted: Element <h2>...</h2> is not clickable at point (614, 20). Other element would receive the click: <a aria-label="Current ..." href="/current/">Students</a>

这是我的代码:

driver = webdriver.Chrome()
driver.get("https://www.mtu.edu/data-science/programs/masters/incoming-students/")
wait = WebDriverWait(driver, 20)

links = driver.find_elements_by_css_selector("div.bar.accordian-title>h2")
for link in links:
    wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, "div.bar.accordian-title>h2")))
    link.click()
    time.sleep(3)

有人知道如何解决此问题吗?预先感谢!

0 个答案:

没有答案