How can I scroll a web page using selenium webdriver in python?

前端 未结 18 1682
孤街浪徒
孤街浪徒 2020-11-22 07:04

I am currently using selenium webdriver to parse through facebook user friends page and extract all ids from the AJAX script. But I need to scroll down to get all the friend

18条回答
  •  攒了一身酷
    2020-11-22 07:27

    same method as shown here:

    in python you can just use

    driver.execute_script("window.scrollTo(0, Y)")
    

    (Y is the vertical position you want to scroll to)

提交回复
热议问题