cookie报错

error:'latin-1' codec can't encode characters in position 770-772: ordinal not in range(256)

 

cookie中出现汉字,使用quote(‘汉字’)转换为编码即可

from urllib.oarse import quote

keyword = ‘你的昵称’

unick = quote(keyword)

'cookie':f'.........unick = {unick}..........'

posted @ 2021-06-08 10:30  布都御魂  阅读(178)  评论(0编辑  收藏  举报