标签:添加 dict https 常用 chrome webdriver sele aaa web
常用操作cookie的方法如下:
from selenium import webdriver driver = webdriver.Chrome() driver.get(‘https://www.baidu.com‘) cookies = driver.get_cookies() # 获取所有cookie cookie = driver.get_cookie(name=‘aaa‘) # 获取key(name)为aaa的cookie driver.add_cookie({‘name‘:‘aaa‘, ‘value‘:‘bbb‘}) # 添加cookie driver.delete_cookie(name=‘aaa‘) # 删除名为aaa的cookie driver.delete_all_cookies() # 删除所有cookie
标签:添加 dict https 常用 chrome webdriver sele aaa web
原文地址:https://www.cnblogs.com/xiaochongc/p/12712743.html