比如你使用selenium使用click操作
driver.find_element(By.CSS_SELECTOR,"#submit").click()
报了下面错误
出现如下异常:
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <\button type="submit" id="submit" class="btn btn-wide btn-primary" data-loading="稍候...">...</button> is not clickable at point (518, 660). Other element would receive the click: <ul class="breadcrumb">...</ul>
(Session info: chrome=78.0.3904.108)
这时候我们怎么来解决呢
解决方法:
使用回车代替点击,使用send_keys操作回车按钮
driver.find_element(By.CSS_SELECTOR,"#submit").send_keys(Keys.ENTER)
只需要把.click()改为.send_keys(Keys.ENTER)即可