|
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
import time
path = r'C:\Users\hzhb\AppData\Roaming\Mozilla\Firefox\Profiles\0sxz7ow0.default'
profile = webdriver.FirefoxProfile(path)
b = webdriver.Firefox(profile)
b.get('http://pan.baidu.com')
time.sleep(5)
user_pwd_login = WebDriverWait(b, 5, 0.5).until(lambda x: x.find_element_by_id('TANGRAM__PSP_4__footerULoginBtn'))
user_pwd_login.click()
username = WebDriverWait(b, 5, 0.5).until(lambda x: x.find_element_by_name('pass-text-input pass-text-input-userName'))
username.send_keys('18716008303')
pwd = WebDriverWait(b, 5, 0.5).until(lambda x: x.find_element_by_name('pass-text-input pass-text-input-password'))
username.send_keys('1739947940zz')
b.find_element_by_id('TANGRAM__PSP_4__submit').click()
time.sleep(5)
cookie = b.get_cookies()
print cookie
b.quit()
C:\Users\hzhb\Desktop\1.jpg |
|