【发布时间】:2017-06-14 21:38:13
【问题描述】:
我正在使用 python 并调用 api 请求。并非所有推文都有quoted_status 字段,因为并非所有推文都被引用。我该如何克服这个错误
AttributeError: 'Status' object has no attribute 'quoted_status'
如果quoted_status 不可用,则打印例如'null'?
我正在循环工作,我的实际代码是这样的:
for status in timeline:
print status.quoted_status
我也尝试了 except 但没有成功。
【问题讨论】: