tags: python WeChat Applets rpa Chat robot
1. Environment
python 3.7, win10 64 -bit operating system
2. dependency package
uiautomation
pywin32
3. Code download
https://github.com/cluic/wxauto
4. Log in to WeChat PC client
# wxauto's code is too long, in https://github.com/Cluic/wxauto
from wxauto import WeChat
# Get the current WeChat client
wx = WeChat()
# Get the session list
wx.GetSessionList()
# Output current chat window Chat message
msgs = wx.GetAllMessage
for msg in msgs:
print('%s : %s'%(msg[0], msg[1]))
## Get more chat records
wx.LoadMoreMessage()
msgs = wx.GetAllMessage
for msg in msgs:
print('%s : %s'%(msg[0], msg[1]))
# Send a message to someone (take the `file transfer assistant` as an example)
msg = 'Hello ~
Who = 'File Transfer Assistant'
wx.chatwith (WHO) # Open the file transmission assistant `chat window
wx.sendmsg (msg) # Send message to the file transfer assistant `: Hello ~
# Send a file to someone (take the `file transfer assistant` as an example, send three different types of files)
file1 = 'D:/test/wxauto.py'
file2 = 'D:/test/pic.png'
file3 = 'D:/test/files.rar'
Who = 'File Transfer Assistant'
wx.chatwith (WHO) # Open the file transmission assistant `chat window
wx.sendfiles (File1, File2, File3) # Send the above three files to the file transfer assistant `
Preface I was learning python recently and found a small demo that automatically sends messages to WeChat. It feels very interesting. I tried it and it was unsuccessful. Because the demo uses the itch...
Principles You can perform the Windows button code, then call the shortcut key of the WeChat program, and then send the relevant messages, not to lose a batch of processing programs Expand You can cha...
Packages to be installed: Here is an example of grabbing the Jinshan Duba sentence. Effect picture: Reference materials: https://zhuanlan.zhihu.com/p/36398109  ...
Ready to work: Go to the corporate WeChat official website and register a company; log in to the corporate WeChat backend and create a "self-built" application to obtain the three necessary ...
I. Overview This article will introduce how to use python3 to send messages to enterprise WeChat. My environment is linux + python3.6.10. Two, python script The places that need to be modified,...
Use Python to let WeChat send real-time information First, import the open CV library in the computer Press the shortcut key win+R to enter cmd Enter the code pip install python-opencv The installatio...
How to add robots to the enterprise WeChat, install them in the python environment, do not go into details, directly upload the code Such as import request error ModuleNotFoundError: No module named &...
What is Server Sauce "Server Sauce", the English name "ServerChan", is a communication software between "mobile phone", "server" and "smart device". s...
Automatically send a WeChat message or a self-use code for QQ messages Waiting time function Send QQ message Send WeChat message 'Forced end VBS operation Key wonderful application here? 'Detect wheth...