headers = {'Host': 'www.creditchina.gov.cn',
'Content-Length': '119',
'X-Requested-With': 'XMLHttpRequest',
'User-Agent': "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36",
'DNT': '1',
'Cache-Control': 'max-age=0'
}
payload = {'t': '1506062526183',
'keyword': '光大',
'searchtype': '0',
'objectType': '2',
'areas': '',
'creditType': '',
'dataType': '1',
'areaCode': '',
'templateId': '',
'exact': '0',
'page': '1'
}
result = requests.post('http://www.creditchina.gov.cn/credit_info_search?', headers=headers, params=payload)
以上是代码,get版的完整url是http://www.creditchina.gov.cn/credit_info_search?t=1506062526183&keyword=%E5%85%89%E5%A4%A7&searchtype=0&objectType=2&areas=&creditType=&dataType=1&areaCode=&templateId=&exact=0&page=1
很奇怪,回到家运行代码还是503,囧....实在搞不清哪里有问题...