python 滚轮动作 报错

下面是代码:

from selenium import webdriver
import time
path = 'G:/tools/chromedriver.exe'
driver = webdriver.Chrome(path)
driver.get('https://www.sohu.com')#请求网页
time.sleep(5)
driver.execute_script("window.scrollto(0,document.body.scrollheight);")
报错图片:

img


问下一想什么情况

"window.scrollTo(0,document.body.scrollHeight)"
scrollto有个字母t小写了。有帮助的话采纳一下哦!

js 大小写敏感 , T是大写

window.scrollTo

滚轮滑动有三种方式:
1.滚动到页面某像素的位置,等号后写像素值。

browser.execute_script(’’‘document.documentElement.scrollTop=1000’’’)

2.从当前位置向下滚动多少像素。

browser.execute_script(“window.scrollTo(0,0)”)

3.定位到特定的元素。

browser.find_element_by_xpath("""//*[@id=“id”]/span/""").send_keys(Keys.DOWN)