繁体   English   中英

如何使用tweepy获取推文的个人资料图片

[英]How to get the profile pictures of tweets using tweepy

我正在获取推文的描述,我只是想知道我是否可以使用tweepy api获取推文的个人资料图片。

这是我获取推文的代码

{
      'protected': False,
      'followers_count': 503785,
      'friends_count': 57994,
      'listed_count': 212,
      'created_at': 'Tue Sep 09 19:10:54 +0000 2014',
      'favourites_count': 463435,
      'utc_offset': None,
      'time_zone': None,
      'geo_enabled': True,
      'verified': False,
      'statuses_count': 105191,
      'lang': 'en',
      'contributors_enabled': False,
      'is_translator': False,
      'is_translation_enabled': False,
      'profile_background_color': 'C0DEED',
      'profile_background_image_url': 'http://abs.twimg.com/images/themes/theme1/bg.png',
      'profile_background_image_url_https': 'https://abs.twimg.com/images/themes/theme1/bg.png',
      'profile_background_tile': False,
      'profile_image_url': 'http://pbs.twimg.com/profile_images/1109808930392363008/OFM92rn__normal.jpg',
      'profile_image_url_https': 'https://pbs.twimg.com/profile_images/1109808930392363008/OFM92rn__normal.jpg',
      'profile_banner_url': 'https://pbs.twimg.com/profile_banners/2800434769/1552662493',
      'profile_link_color': '1DA1F2',
      'profile_sidebar_border_color': 'C0DEED',
      'profile_sidebar_fill_color': 'DDEEF6',
      'profile_text_color': '333333',
      'profile_use_background_image': True,
      'has_extended_profile': True,
      'default_profile': True,
      'default_profile_image': False,
      'following': None,
      'follow_request_sent': None,
      'notifications': None,
      'translator_type': 'none'
    },

答案是简单地迭代结果和json

for x in results:
    print(x.user.profile_image_url)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM