注意:python 版本 3.10.9
在使用 request.get(url, headers =header)方法时候, 由于请求头中有冒号的参数:
:authority :method :path :scheme
运行py文件就直接报错:
valueError: Invalid header name b':authority'
搜到的方法有两种,hyper 和 httpx
hyper
pip 安装之后,运行直接报错,
ImportError: cannot import name ‘Iterable’ from 'collections'
需要改为 from collections.abc import Iterable
Iterable以及以下collections的方法都在3.10版本后被取消了。
["Awaitable", "Coroutine", "AsyncIterable", "AsyncIterator", "AsyncGenerator", "Hashable", "Itera