cookie操作

import time
from selenium.webdriver.support.select import Select
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
driver=webdriver.Chrome()
driver.get('https://www.cnblogs.com')
driver.maximize_window()
print(driver.title)
driver.implicitly_wait(5)
print("before login:")
for cookie in driver.get_cookies():
    print(cookie)
time.sleep(30)  # 这里等待30秒,手动输入账号密码
for cookie in driver.get_cookies():
    print(cookie)
posted @ 2019-12-19 14:16  九州天空城  阅读(131)  评论(0编辑  收藏  举报