requests.get请求报latin-1‘ codec can‘t encode characters in position 373-378: ordinal not in range(256)

Python  python requests.get报错traceback  unicodeerror

latin-1' codec can't encode characters in position 373-378: ordinal not in range(256)

当cookie中有中文编码时需要这样处理

Cookie=r'cookie值'

cookie = cookie.encode("utf-8").decode("latin1")

猜你喜欢

转载自blog.csdn.net/qq_41638825/article/details/130042139