标签:asc set 通过 driver cli www selenium cut imp
from selenium import webdriver
from time import sleep
driver = webdriver.Firefox()
driver.get("http://www.baidu.com")
driver.set_window_size(600,600)
driver.find_element_by_id("kw").send_keys("selenium")
driver.find_element_by_id("su").click()
sleep(2)
#通过JavaScript设置浏览器窗口的滚动条位置左边距100、上边距450
js = "window.scrollTo(100,450);"
driver.execute_script(js)
标签:asc set 通过 driver cli www selenium cut imp
原文地址:https://www.cnblogs.com/zhang-da/p/12210695.html