首页 > 代码库 > selenium学习:调用javaScript

selenium学习:调用javaScript

文件名:test15.py

#coding=utf-8
from selenium import webdriver
import time,os
driver = webdriver.Chrome()
driver.get("http://www.baidu.com")

driver.find_element_by_id("kw").send_keys("selenium")
time.sleep(2)
driver.find_element_by_id("su").click()
time.sleep(5)

js = "window.scrollTo(600,600);"
driver.execute_script(js)
print(‘aa‘)
time.sleep(5)
driver.quit()


selenium学习:调用javaScript