用Python得到好友的头像 储存在本地电脑中
import itchat
import math
import PIL.Image as Image
import os
# 先登录
itchat.auto_login(hotReload=True)
# 获取好友列表
friends = itchat.get_friends(update=True)[0:]
user=friends[0]["UserName"]
num =0
for i in friends:
img=itchat.get_head_img(userName=i["UserName"])
fileImage=open('D:'+"/"+str(num)+".jpg",'wb')
fileImage.write(img)
fileImage.close()
num+=1