在用于flickr流的python库flickr中,getcomment()方法不返回注释。下面是这些方法
def getComments(self):
""""
get list of comments for photo
returns a list of comment objects
comment text is in return [item].text
"""
method = "flickr.photos.comments.getList"
try:
data = _doget(method, photo_id=self.id)
except FlickrError: # ???? what errors might there be????
return None
return data.rsp.comments输出为
<flickr.Bag instance at 0x03F9D378>
8532177364
<flickr.Bag instance at 0x03459828>
8528705440
<flickr.Bag instance at 0x0359B620>
8524405870
<flickr.Bag instance at 0x02D5E1C0>
8521650007
<flickr.Bag instance at 0x02C4CE90>
8519752817
<flickr.Bag instance at 0x02C4CBC0>发布于 2014-09-27 23:42:51
尝试这个(未测试)
comments = photo.getComments() # Replace photo with name of your object
for comment in comments :
print comment.texthttps://stackoverflow.com/questions/26075946
复制相似问题