【发布时间】:2021-10-20 13:58:32
【问题描述】:
我已经用 Python 和 Selenium 编写了一个“Lovoo”机器人,并且快完成了。
现在我有以下问题:
当机器人点击用户时,会打开一个窗口。要退出此窗口,机器人必须在其外部单击。
但是从那时起,所有源代码都已更改,我无处可使用 xpath 或单击 selenium。我根本无法获得任何有效的 xpath。
我试过了
WebDriverWait(DRIVER,10).until(EC.element_to_be_clickable((By.XPATH,'//body[1]')))
DRIVER.find_element_by_xpath('//body[1]).click()
但点击只是随机且很少发生。
错误:
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <div class="thumbnail thumbnail-square u-margin-0">...</div> is not clickable at point (370, 497). Other element would receive the click: <div class="absolute-fill text-left" ng-transclude=""></div>
(Session info: chrome=96.0.4664.9)
我不想用
action.click()
因为那样我就不能用鼠标做其他事情了。
【问题讨论】: