我正在使用Python中的Google来查询我的Google联系人列表。我可以让这个特性工作,但是一个特定的操作不起作用。
results = service.people().connections().list(
resourceName='people/me',
pageSize=1,
personFields='names,phoneNumbers').execute()
connections = results.get('connections', [])
for person in connections:
data = person.get('names', [])这是有用的--它给了我一张名单。不过,我想要一个名字和电话号码的清单。如果我这么做:
for person in connections:
data = person.get('phoneNumbers', [])这也很管用。我有一张电话号码的清单。然而,如果我试图两者兼得,我就没有结果:
for person in connections:
data = person.get('names,phoneNumbers', [])根据我对People API文档(https://developers.google.com/people/api/rest/v1/people/get)的解释,这应该是可行的。相反,我什么也得不到。
我做错了什么?
https://stackoverflow.com/questions/70014308
复制相似问题