requests post <Response [500]>解决方法之一
在爬取上海政府采购网中,post返回值一直是<Response [500]>,“系统出错,请稍后重试”,现贴源码如下:
url='http://www.zfcg.sh.gov.cn/front/search/category'
headers={
'Host':'www.zfcg.sh.gov.cn',
'Connection':'keep-alive',
'Content-Length':'83',
'Accept':'*/*',
'X-Requested-With':'XMLHttpRequest',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36 Edg/88.0.705.63',
'Content-Type':'application/json',
'Origin':'http://www.zfcg.sh.gov.cn',
'Referer':'http://www.zfcg.sh.gov.cn/ZcyAnnouncement/ZcyAnnouncement2/index.html',
'Accept-Encoding':'gzip, deflate',
'Accept-Language':'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en