尝试过使用如下命令,但没有成功
pip install brotli
Brotli Encoding
Brotli is a compression algorithm created by Google with better compression than gzip and deflate and is supported by urllib3 if the brotlipy package is installed. You may also request the package be installed via the
urllib3[brotli]
extra:python -m pip install urllib3[brotli]Here’s an example using brotli encoding via the
Accept-Encoding
header:>>> from urllib3 import PoolManager >>> http = PoolManager() >>> http.request('GET', 'https://www.google.com/', headers={'Accept-Encoding': 'br'})
换成urllib3库就不会乱码了