The Windows version of WeChat client is automated, enabling simple sending and receiving of WeChat messages and saving chat pictures.
Download version 3.9.11.17 WeChat installation package : Click to download
Documentation : Usage Documentation | Cloud Server wxauto Deployment Guide
environment | Version |
---|---|
OS | |
Python | (3.7.6 and 3.8.1 are not supported) |
cmd window:
pip install wxauto
python window:
> >> import wxauto
> >> wxauto . VERSION
'3.9.11.17'
> >> wx = wxauto . WeChat ()
初始化成功,获取到已登录窗口: xxx
Note
If you have any questions, please check the usage documentation first
Please log in to the PC WeChat client first
from wxauto import *
# 获取当前微信客户端
wx = WeChat ()
# 获取会话列表
wx . GetSessionList ()
# 向某人发送消息(以`文件传输助手`为例)
msg = '你好~'
who = '文件传输助手'
wx . SendMsg ( msg , who ) # 向`文件传输助手`发送消息:你好~
# 向某人发送文件(以`文件传输助手`为例,发送三个不同类型文件)
files = [
'D:/test/wxauto.py' ,
'D:/test/pic.png' ,
'D:/test/files.rar'
]
who = '文件传输助手'
wx . SendFiles ( filepath = files , who = who ) # 向`文件传输助手`发送上述三个文件
# 下载当前聊天窗口的聊天记录及图片
msgs = wx . GetAllMessage ( savepic = True ) # 获取聊天记录,及自动下载图片
It is still under development, there are few test cases, and you may encounter various bugs during use.
WeChat communication group
If it is helpful to you, I hope you can give me a star. If you are using this project, you can click Unwatch in the upper right corner as Watching so that I can receive feedback after I update or fix some bugs. Thank you for your support. Thank you so much!
The code is only used for communication and learning about UIAutomation technology. It is prohibited to be used in actual production projects. Please do not use it for illegal or commercial purposes! If any legal disputes arise as a result, the author has nothing to do with it!