赞
踩
学习笔记~
from selenium import webdriver from selenium.webdriver.common import keys from selenium.webdriver.common.by import By import time from selenium.webdriver import ActionChains from selenium.webdriver.support.select import Select driver = webdriver.Chrome() # ===============模拟操作cookies==================== driver.get('https://baidu.com/') # 1.获取cookies信息 cs = driver.get_cookies() print(cs) # 单独获取某个cookies cv = driver.get_cookie("ZFY") print(cv) # 2添加cookeis信息 cookie = {"name": "aaa", "value": "bbb"} driver.add_cookie(cookie) print(driver.get_cookie("aaa")) # 3.删除cookies信息 driver.delete_cookie("aaa") print(driver.get_cookie("aaa")) time.sleep(2)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。