[{"nick":"董占品","orgUserName":"董占品","emplId":"02143269235433252612","corpId":"dingef2eb0ecba261b8935c2f4657eb6378f","name":"董占品","selectDeptName":"漕物业新银大厦","avatar":"","selectDeptId":829654324}]我想获取其中的nick,emplId,selectDeptName要怎么做
时间: 2023-07-07 19:46:03 浏览: 147
dingtalk:钉钉桌面版,基于电子和钉钉网页版开发,支持Windows,Linux和macOS
这个看起来像是一个 JSON 格式的数据,你可以使用 Python 中的 json 库来解析该数据,然后提取出所需的信息。以下是一个示例代码:
```python
import json
data = '[{"nick":"董占品","orgUserName":"董占品","emplId":"02143269235433252612","corpId":"dingef2eb0ecba261b8935c2f4657eb6378f","name":"董占品","selectDeptName":"漕物业新银大厦","avatar":"","selectDeptId":829654324}]'
# 解析 JSON 数据
parsed_data = json.loads(data)
# 提取所需信息
nick = parsed_data[0]['nick']
emplId = parsed_data[0]['emplId']
selectDeptName = parsed_data[0]['selectDeptName']
# 输出结果
print('nick:', nick)
print('emplId:', emplId)
print('selectDeptName:', selectDeptName)
```
输出结果应该为:
```
nick: 董占品
emplId: 02143269235433252612
selectDeptName: 漕物业新银大厦
```
阅读全文