我正在开发一个instagram机器人,其中包括一些不关注的人。 它与selenium一起工作,方法是登录,单击“follow”,然后为每个用户单击unfollow按钮。问题是:当我尝试单击它时,此异常会发生:
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <button class="sqdOP L3NKy _4pI4F _8A5w5 " type="button">...</button> is not clickable at point (594, 155). Other element would receive the click: <span class="">...</span>
(Session info: chrome=79.0.3945.130)
这是我的密码:
unfollow_buttons = driver.find_elements_by_css_selector('.sqdOP.L3NKy._8A5w5')
for button in unfollow_buttons:
ui.WebDriverWait(driver, 5).until(
EC.element_to_be_clickable((By.CSS_SELECTOR,
'.sqdOP.L3NKy._8A5w5')))
button.click()
ui.WebDriverWait(driver, 2).until(
EC.element_to_be_clickable((By.XPATH, '/html/body/div[5]/div/div/div[3]/button[1]')))
driver.find_element_by_xpath('/html/body/div[5]/div/div/div[3]/button[1]').click()
我知道另一个项目会收到点击,但我不知道它是什么项目。有人能帮我吗
如果有人看到这一点,我会这样做:
相关问题 更多 >
编程相关推荐