Search code examples
pythonfacebookseleniumweb-scrapingscrollview

Scrolling through list using selenium Python till end


I'm trying to scroll through my facebook friendlist / chatlist using selenium webdriver via python but it only scrolls web page and not that list.

I tried something like this:

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

But nothing happened!

Can anyone please share how it can be done.


Solution

  • Use a for loop.

    Say:

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