#coding=utf-8
from selenium import webdriver
import time
import http.cookiejar, urllib.request
driver = webdriver.PhantomJS()
driver.get("http://tieba.baidu.com/")
#点击登录链接
time.sleep(2)
driver.find_element_by_link_text(u"登录").click()
time.sleep(2)
driver.find_element_by_id("TANGRAM__PSP_10__footerULoginBtn").click()
time.sleep(2)
driver.find_element_by_id("TANGRAM__PSP_10__userName").clear()
driver.find_element_by_id("TANGRAM__PSP_10__userName").send_keys('####')
driver.find_element_by_id("TANGRAM__PSP_10__password").clear()
driver.find_element_by_id("TANGRAM__PSP_10__password").send_keys('******')
driver.find_element_by_id("TANGRAM__PSP_10__submit").click()
time.sleep(3)
#driver.get_screenshot_as_file("C:\\1.png")
网友评论