I am trying to click on the "All Topics" and "All States" CheckBoxes then search the results. When I run the script, a chrome window opens up in size 1036x674.
If I leave the window alone, I get element click interception errors. If I minimize or maximize the window, my script works fine.
I am using Selenium 3.141.0, chrome 76, chromedriver 76, and python 3.6
chromedriver_path = r"C:Userspathochromedriver.exe"
browser = webdriver.Chrome(executable_path=chromedriver_path)
url = "http://www.ncsl.org/research/transportation/autonomous-vehicles-legislative-database.aspx"
topics_xpath = "//*[@id="dnn_ctr81355_StateNetDB_UpdatePanel1"]/div[1]/div[2]/span/label"
states_xpath = "//*[@id="dnn_ctr81355_StateNetDB_UpdatePanel1"]/div[2]/div[2]/span/label"
browser.get(url)
time.sleep(30)
elem = browser.find_element_by_xpath(topics_xpath)
elem.click()
time.sleep(5)
elem = browser.find_element_by_xpath(states_xpath)
elem.click()
But I get this error:
ElementClickInterceptedException: Message: element click intercepted:
Element <label for="dnn_ctr81355_StateNetDB_ckBxAllTopics">...</label> is not clickable at point (259, 665).
Other element would receive the click:
<label for="dnn_ctr81355_StateNetDB_ckBxTopics_0">...</label>
(Session info: chrome=76.0.3809.100)
The CheckBox that would be clicked is right below the one I am trying to click.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…