response 长这样 {'keyBoardList': [{'orgId': 'gssz0000001', 'category': 'A 股', 'plate': 'szse', 'code': '000001', 'pinyin': 'payh', 'zwjc': '平安银行'}], 'classifiedAnnouncements': [{'id': None, 'secCode': '000001', 'secName': '平安银行', 'orgId': 'gssz0000001', 'announcementId': '1212287014', 'announcementTitle': '平安银行股份有限公司关联交易公告', 'announcementTime': 1643212800000, 'adjunctUrl': 'finalpage/2022-01-27/1212287014.PDF', 'adjunctSize': 108, 'adjunctType': 'PDF', 'storageTime': None, 'columnId': '09020202||250101||251302', 'pageColumn': 'SZZB', 'announcementType': '01010503||010112||011719', 'associateAnnouncement': None, 'important': None, 'batchNum': None, 'announcementContent': '', 'orgName': None, 'announcementTypeName': None}, {'id': None, 'secCode': '000001', 'secName': '平安银行', 'orgId': 'gssz0000001', 'announcementId': '1212287015', 'announcementTitle': '平安银行股份有限公司关联交易公告', 'announcementTime': 1643212800000, 'adjunctUrl': 'finalpage/2022-01-27/1212287015.PDF', 'adjunctSize': 180, 'adjunctType': 'PDF', 'storageTime': None, 'columnId': '09020202||250101||251302', 'pageColumn': 'SZZB', 'announcementType': '01010503||010112||011719', 'associateAnnouncement': None, 'important': None, 'batchNum': None, 'announcementContent': '', 'orgName': None, 'announcementTypeName': None}, {'id': None, 'secCode': '000001', 'secName': '平安银行', 'orgId': 'gssz0000001', 'announcementId': '1212287017', 'announcementTitle': '平安银行股份有限公司关联交易公告', 'announcementTime': 1643212800000, 'adjunctUrl': 'finalpage/2022-01-27/1212287017.PDF', 'adjunctSize': 182, 'adjunctType': 'PDF', 'storageTime': None, 'columnId': '09020202||250101||251302', 'pageColumn': 'SZZB', 'announcementType': '01010503||010112||011719', 'associateAnnouncement': None, 'important': None, 'batchNum': None, 'announcementContent': '', 'orgName': None, 'announcementTypeName': None}, {'id': None, 'secCode': '000001', 'secName': '平安银行', 'orgId': 'gssz0000001', 'announcementId': '1212287016', 'announcementTitle': '平安银行股份有限公司关联交易公告', 'announcementTime': 1643212800000, 'adjunctUrl': 'finalpage/2022-01-27/1212287016.PDF', 'adjunctSize': 145, 'adjunctType': 'PDF', 'storageTime': None, 'columnId': '09020202||250101||251302', 'pageColumn': 'SZZB', 'announcementType': '01010503||010112||011719', 'associateAnnouncement': None, 'important': None, 'batchNum': None, 'announcementContent': '', 'orgName': None, 'announcementTypeName': None}, {'id': None, 'secCode': '000001', 'secName': '平安银行', 'orgId': 'gssz0000001', 'announcementId': '1212287018', 'announcementTitle': '平安银行股份有限公司独立董事独立意见', 'announcementTime': 1643212800000, 'adjunctUrl': 'finalpage/2022-01-27/1212287018.PDF', 'adjunctSize': 199, 'adjunctType': 'PDF', 'storageTime': None, 'columnId': '09020202||250101||251302', 'pageColumn': 'SZZB', 'announcementType': '01011107||010112||01310565', 'associateAnnouncement': None, 'important': None, 'batchNum': None, 'announcementContent': '', 'orgName': None, 'announcementTypeName': None}]}
然后我取
r = requests.post(url, headers=hd, data=data)
print(r.json())
#print(r.json()['keyBoardList'])
org_id = r.json()['keyBoardList'][0]['orgId']
总是提示我 out of range
print(r.json())会多出一个[].感觉有点奇怪啊
请教,这个有没有好的办法呢
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.