使用 selenium Python 滚动列表直到结束

Scrolling through list using selenium Python till end

我正在尝试通过 python 使用 selenium webdriver 滚动我的 Facebook 好友列表/聊天列表,但它只滚动网页而不是那个列表。

我试过这样的事情:

list = driver.find_elements_by_xpath('xpath')
hover = ActionChains(driver).move_to_element(list)
hover.perform()

但是什么也没发生!

任何人都可以分享如何做到这一点。

使用 for 循环。

说:

for element in list:
    hover = ActionChains(driver).move_to_element(element)

    hover.perform()