Python比较两个Cookie之间的差异

python如何比较两个cookie字符串之间的差异

pip安装:

pip install datedays

代码:

cookie1 = 'JSESSIONID=123456789; key1=jiuliang; key2=2023; key3=1538; '
cookie2 = 'JSESSIONID=123456789; key1=jiuliang; key4=0818; '
print(datedays.cookie_difference(cookie1, cookie2))

返回结果:

key2,key3是cookie1独有的key

key4是cookie2独有的key

[['key2', 'key3'], ['key4']]

猜你喜欢

转载自blog.csdn.net/qq_33613696/article/details/132363387