代码如下:
import json
import requests
url='http://xueqiu.com/statuses/search.json?count=15&comment=0&symbol=SZ002102&hl=0&source=all&sort=alpha&page=1&_=1451353577677'
headers={
'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.5 Safari/534.30'
}
cont=requests.get(url,headers=headers).content
为什么返回结果是'{"error_description":"\xe9\x81\x87\xe5\x88\xb0\xe9\x94\x99\xe8\xaf\xaf\xef\xbc\x8c\xe8\xaf\xb7\xe5\x88\xb7\xe6\x96\xb0\xe9\xa1\xb5\xe9\x9d\xa2\xe6\x88\x96\xe8\x80\x85\xe9\x87\x8d\xe6\x96\xb0\xe7\x99\xbb\xe5\xbd\x95\xe5\xb8\x90\xe5\x8f\xb7\xe5\x90\x8e\xe5\x86\x8d\xe8\xaf\x95","error_uri":"/statuses/search.json","error_code":"400016"}'
而不是json文件里面的内容呢
这个是返回的错误信息了,你提交的请求被服务器拒绝了,应该有参数等没有配置对