python3 设置滚动条
#!python3
#coding=utf-8
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
driver=webdriver.Chrome()
driver.get('http://www.baidu.com')
driver.set_window_size(900,900)
driver.find_element(By.ID,'kw').send_keys('selenium')
driver.find_element(By.ID,'su').click()
js="window.scrollTo(1000,9000);" #如果执行没有效果,没有报错,请确定页面宽度要大于浏览器的宽度
time.sleep(3)
driver.execute_script(js)