python错误TypeError: request() got an unexpected keyword argument 'date'

程序
import requests
if name=='__main__':
url='http://www.kfc.com.cn/kfccda/ashx/GetStoreList.ashx?op=keyword'
date={
'cname':'',
'pid':'',
'keyword': '北京',
'pageIndex': '1',
'pageSize': '10'
}
header={
'User - Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36 Edg/85.0.564.44'
}
respons=requests.post(url=url,date=date,headers=header)
print(respons.text)
错误
Traceback (most recent call last):
File "C:/Users/86151/PycharmProjects/untitled/venv/08.py", line 14, in
respons=requests.post(url=url,date=date,headers=header)
File "C:\Users\86151\PycharmProjects\untitled\venv\lib\site-packages\requests\api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Users\86151\PycharmProjects\untitled\venv\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
TypeError: request() got an unexpected keyword argument 'date'

查看全部
qq_50617823
qq_50617823
2020/09/10 13:15
  • python
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复