hello!python!

selenium+python 移动鼠标方法

 

 

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver=webdriver.Chrome()
driver.get('http://www.baidu.com')
driver.find_element_by_id('lb').click()
#driver.find_element_by_id('TANGRAM__PSP_10__unameLoginLink').click()
time.sleep(3)
driver.find_element_by_name('userName').send_keys('id')
driver.find_element_by_name('password').send_keys('passwd')
driver.find_element_by_id('TANGRAM__PSP_10__submit').click()
driver.find_element_by_css_selector('.user-name-top')
webdriver.ActionChains(driver).move_to_element(user).perform() #移动鼠标到我的用户名
driver.find_element_by_css_selector('a.sep').click()

 

posted @ 2013-09-09 16:13  你坚持了吗  阅读(15087)  评论(0编辑  收藏  举报
hello!python!