我使用python 3.7.4、最新的selenium和geckodriver以及Firefox版本69.0.1。我试图简单地使用点击()点击‘我感到幸运’按钮在谷歌主页,但我得到了错误的selenium.common.exceptions.ElementNotInteractableException: Message这是代码:import time
dr
Selenium click似乎不起作用,除非元素是可见的。因此,我希望在单击之前将元素带到视图中。Selenium中有一个focus方法,但它似乎不会滚动视图。我尝试了 for Scroll Element into View with Selenium,但有时元素仍然在导航栏下。有没有办法滚动到元素变得可见,并且selenium可以点击它?
我查看了文档,因此,下面是最相关的答案:WebElement element = driver.findElementActions(driver);## actions.click();当我尝试使用上面的内容滚动到元素时我已经找到了WebElement的导入方法:
from selenium.webdriver.r