好友
阅读权限10
听众
最后登录1970-1-1
|
楼主|
zqlcpu
发表于 2022-5-29 10:26
错误信息
Python 3.11.0a7 (main, Apr 5 2022, 21:27:39) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
==================== RESTART: C:/Users/zqlcpu/Desktop/3.0.py ===================
Traceback (most recent call last):
File "C:/Users/zqlcpu/Desktop/3.0.py", line 21, in <module>
resp = requests.get(url=url, params=param, headers=header)
File "E:\python3.10.4\Lib\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "E:\python3.10.4\Lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "E:\python3.10.4\Lib\site-packages\requests\sessions.py", line 515, in request
prep = self.prepare_request(req)
File "E:\python3.10.4\Lib\site-packages\requests\sessions.py", line 443, in prepare_request
p.prepare(
File "E:\python3.10.4\Lib\site-packages\requests\models.py", line 319, in prepare
self.prepare_headers(headers)
File "E:\python3.10.4\Lib\site-packages\requests\models.py", line 453, in prepare_headers
check_header_validity(header)
File "E:\python3.10.4\Lib\site-packages\requests\utils.py", line 1025, in check_header_validity
raise InvalidHeader("Invalid return character or leading space in header: %s" % name)
requests.exceptions.InvalidHeader: Invalid return character or leading space in header: User-Agent |
|