检索 flickr 收藏夹
我无法让它工作...可能是什么问题?
import flickrapi
api_key = '1234...'
flickr = flickrapi.FlickrAPI(api_key)
user = '43699959@N02'
favs = flickr.favorites_getPublicList(user_id = user)
>>> favs.items()
[('stat', 'ok')]
>>> favs.text
'\n'
我最喜欢的照片在哪里?
注意:它确实可以通过此测试页面工作: http:// /www.flickr.com/services/api/explore/?method=flickr.favorites.getPublicList
I can't get this to work... what could be the problem?
import flickrapi
api_key = '1234...'
flickr = flickrapi.FlickrAPI(api_key)
user = '43699959@N02'
favs = flickr.favorites_getPublicList(user_id = user)
>>> favs.items()
[('stat', 'ok')]
>>> favs.text
'\n'
Where are my favorite photo's?
Note: It does work via this testing page: http://www.flickr.com/services/api/explore/?method=flickr.favorites.getPublicList
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
结果是正确的——根据您提供的 URL,XML 节点是空的(显然,加/减换行符和空格字符)。
favs.text
将返回内容,但您要查找的是属性。试试这个:结果:
或者对于所有子节点,从根开始:
结果:
The result is correct -- as per the URL you gave, the XML nodes are empty (plus/minus newline and whitespace characters, apparently).
favs.text
would return the content, but what you're looking for is in the attributes. Try this:Result:
Or for all child nodes, starting from the root:
Result: