def add_ck(a):
browser.delete_all_cookies()#删除原有cookies
#cookies 在浏览器里面复制
a ='BIDUPSID=B8D733AE1AF91ABF07AE6448B2DF91AA; PSTM=1615989783; BD_UPN=12314753; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; __yjs_duid=1_1e44a5dbc5fcbd4e11c4391de4c7d06d1618668022429;'
a = a.split(';')
for i in a:
i = i.split('=')
s = {
'name':re.sub(' ','',i[0]),
'value':i[1],
'domain':'.u.ccb.com',
}
browser.add_cookie(s)
cookies添加python selenium
最新推荐文章于 2023-12-13 20:54:33 发布