python使用wxauto库来获取发送pc端微信好友消息代码

代码语言:python

所属分类:其他

代码描述:python使用wxauto库来获取发送pc端微信好友消息代码,可以获取聊天对象所有的聊天信息,还可以给指定好友发送消息,全程自动化操作。

代码标签: python wxauto 获取 发送 pc端 微信 好友 消息 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

#!/usr/local/python3/bin/python3
# -*- coding: utf-8 -*
#1. 环境python 3.7, win10 64位操作系统
#依赖包下载pip install wxauto

from wxauto import WeChat
 
# 获取当前微信客户端
wx = WeChat()
 
# 获取会话列表
wx.GetSessionList()
 
# 输出当前聊天窗口聊天消息
msgs = wx.GetAllMessage
for msg in msgs:
    print('%s : %s'%(msg[0], msg[1]))
## 获取更多聊天记录
wx.LoadMoreMessage()
msgs = wx.GetAllMessage
for msg in msgs:
    pr.........完整代码请登录后点击上方下载按钮下载查看

网友评论0