首页 > 代码库 > 百度登录

百度登录

# coding:utf-8from selenium import webdriverimport timebs=webdriver.Firefox()bs.get(http://www.baidu.com)bs.find_element_by_xpath(".//*[@id=‘u1‘]/a[6]").click()#切换到当前窗口bs.current_window_handlebs.find_element_by_id(TANGRAM__PSP_8__userName).send_keys(xxxxxx)bs.find_element_by_id(TANGRAM__PSP_8__password).send_keys(xxxxxxx)bs.find_element_by_id(TANGRAM__PSP_8__password).submit()time.sleep(5)bs.close()

 

百度登录