简体   繁体   中英

How to get the profile pictures of tweets using tweepy

I am getting the description of tweets I just wanted to know whether i can get the profile pictures of the tweets using tweepy api.

this is my code for getting tweets

{
      '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'
    },

The answer is simply iterate the results and json

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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