webdriver可以使用javascipt,通过调用webdriver的execute_script(js)方法来执行js的功能,具体操作如下:
from selenium import webdriver
from time import sleep
driver = webdriver.Firefox()
driver.get("https://www.baidu.com")
driver.set_window_size(800,600)
sleep(3)
js = "window.scrollTo(0,200)"
driver.execute_script(js)
sleep(3)
driver.quit()