Python利用itchat登录微信给好友发送信息

导入itchat

import itchat

登录微信

itchat.auto_login()

获取好友信息

info = itchat.search_friends(nickName='安能')

或者

info = itchat.search_friends(name=u'安能')

获取UserName

id = info[0]['UserName']

发送Hello

itchat.send('Hello',id)
发布了35 篇原创文章 · 获赞 30 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_43792401/article/details/100148321