代码拉取完成,页面将自动刷新
# coding=utf-8
# pip install -U wxpy
from wxpy import *
import os,sys
# https://blog.csdn.net/hellokandy/article/details/90665129
# 初始化机器人,扫码登陆微信-Windows系统
# #初始化执行登陆操作,需要手机扫描登陆
# 初始化机器人,扫码登陆微信-Windows系统
# #初始化执行登陆操作,需要手机扫描登陆
# (1)极简模式:robot = Bot()
# (2)终端模式:robot = Bot(console_qr=True)
# (3)缓存模式(可保持登录状态):robot = Bot(cache_path=True)
# bot = Bot()
bot = Bot(cache_path=True)
# bot = Bot(console_qr=True)
# linux系统,执行登陆请调用下面语句
# bot=Bot(console_qr=2,cache_path="botto.pkl")
# 获取当前路径信息
image_dir=os.getcwd()+"\\"+'FriendImgs\\'
# 如果保存头像的 FriendImgs 目录不存在就创建一个
if not os.path.exists(image_dir):
os.makedirs(image_dir)
os.popen('explorer '+image_dir)
my_friends=bot.friends(updata=True)
# 获取好友头像并存储到 FriendImgs 目录中
n=0
for friend in my_friends:
print(friend)
image_name=image_dir+str(n)+'.jpg'
friend.get_avatar(image_name)
n=n+1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。