模拟登陆百度 python
from time import sleep from selenium import webdriver driver = webdriver.Firefox() driver.get('http://www.baidu.com/') driver.find_element_by_id('lb').click(); driver.find_element_by_id('TANGRAM__PSP_10__unameLoginLink').click() driver.find_element_by_id('TANGRAM__PSP_10__userName').send_keys('用户名'); driver.find_element_by_id('TANGRAM__PSP_10__password').send_keys('密码'); driver.find_element_by_id('TANGRAM__PSP_10__submit').click() sleep(5) driver.quit()