发送消息有两种方式
# 方法1
send_button = wechat_window.ButtonControl(Name='发送(S)')
if send_button.Exists():
# 点击发送按钮
send_button.Click()
else:
print("未找到发送按钮")
# 方法2
auto.SendKeys('{ENTER}') # 模拟enter
python+uiautomation 微信自动发送消息完整代码
import time
import uiautomation as auto
# 定位微信的主窗口
wechat_window = auto.WindowControl(searchDepth=1