【发布时间】:2013-06-22 14:54:20
【问题描述】:
试图仅访问多伦多趋势中的“名称”部分。 到目前为止,我有这个,但它给了我错误:
toronto = t.get_place_trends(id=4118)
trend_array = []
for trend in toronto.trends.name:
trend_array.append(trend)
print trend_array
print trend
在 auth 之后返回整个对象列表,该列表被强制放入一个数组(由于某种原因不能通过索引访问)并作为一个列表返回。
【问题讨论】:
-
您遇到什么错误?你知道返回值是什么数据类型吗?您可以在第一行之后添加打印类型(toronto)进行确认。
-
but it is giving me errors,您能告诉我们错误吗?不知道问题就解决不了。