无法从Python请求中检索响应数据

时间:2019-01-23 07:14:06

标签: python web-scraping python-requests

当尝试从网站获取响应时,我正在JSON响应中获取数据。但是在控制台中,它显示的是数据。

我已经尝试过并且得到的响应是

"{'Page': '1', 
  'TotalPage': '538', 
  'CurrentPage': '53794', 
  'Total': '53794', 
  'Data': '[{},{},{},{},{},{},{},{},{},{},{},{},{},
            {},{},{},{},{},{},{},{},{},{},{},{},{},
            {},{},{},{},{},{},{},{},{},{},{},{},{},
            {},{},{},{},{},{},{},{},{},{},{},{},{},
            {},{},{},{},{},{},{},{},{},{},{},{},{},
            {},{},{},{},{},{},{},{},{},{},{},{},{},
            {},{},{},{},{},{},{},{},{},{},{},{},{},
            {},{},{},{},{},{},{},{},{}]', 
 'ResultClientGrp': '[{"client_group_id":1,"client_group_no":"16000001}]"}

但是在浏览器控制台中:

{"Page":"1",
 "TotalPage":"538",
 "CurrentPage":"53794",
 "Total":"53794",
 "Data":" [{\"id\":52523,\"_no\":323,\"masteno\":18,\"deletes\":0,\"NAME\":\"XXXXX YYYYY\",}......etc
search_response = session.post(url, data=data,params=parameters)
                    print(search_response.json())
                    data = (search_response.json()['Data'])
                    for order in json.loads(data):
                           print(order)

预期为:

52523
538
53794.....etc

0 个答案:

没有答案