Giter VIP home page Giter VIP logo

wxauto's Introduction

wxauto (适用PC微信3.9.8.15版本)

2023-11-20重写wxauto,欢迎指出bug,欢迎pull requests

Windows版本微信客户端自动化,可实现简单的发送、接收微信消息、保存聊天图片

3.9.8.15版本微信安装包下载点击下载

文档使用文档 | 云服务器wxauto部署指南

环境 版本
OS Windows
微信 Wechat (3.9.9疑似容易掉线)
Python Python (不支持3.7.6和3.8.1)

Star History Chart

获取wxauto

cmd窗口:

pip install wxauto

python窗口:

>>> import wxauto
>>> wxauto.VERSION
'3.9.8.15'
>>> wx = wxauto.WeChat()
初始化成功获取到已登录窗口xxx

示例

请先登录PC微信客户端

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)   # 获取聊天记录,及自动下载图片

注意事项

目前还在开发中,测试案例较少,使用过程中可能遇到各种Bug

如果遇到问题或者有新的想法,希望您可以通过以下两种方式联系我进行改进:

  • 微信:louxinghao(请备注wxauto,加群请备注加入交流群,合作、定制请备注合作)
  • 微信

最后

如果对您有帮助,希望可以帮忙点个Star,如果您正在使用这个项目,可以将右上角的 Unwatch 点为 Watching,以便在我更新或修复某些 Bug 后即使收到反馈,感谢您的支持,非常感谢!

免责声明

代码仅供交流学习使用,请勿用于非法用途和商业用途!如因此产生任何法律纠纷,均与作者无关!

wxauto's People

Contributors

agit-internet avatar cluic avatar gao-gao-zai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wxauto's Issues

wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}

hi 老哥:
我在用wx.GetAllMessage[-6:] 取置顶群的最后几个消息的时候(大约1s取一次),如果群里出现某人拍了拍某人,监控就会不停的出现下面的打印,请问下有什么方法可以处理吗?谢谢。
2022-08-15 20:59:33.273 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:34.406 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:35.537 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:36.669 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:37.817 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:38.956 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:40.087 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:41.227 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:42.372 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:43.552 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:44.731 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:45.924 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:47.099 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:48.267 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:49.452 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:50.637 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:51.819 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:53.016 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:54.229 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:55.368 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-15 20:59:56.566 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}

用户

你好请问当前库,有提供消息转发和获取好友列表的API吗

子线程中使用调用发送,报Can not load UIAutomationCore.dll.报错Can not load UIAutomationCore.dll.

Can not load UIAutomationCore.dll.
1, You may need to install Windows Update KB971513 if your OS is Windows XP, see https://github.com/yinkaisheng/WindowsUpdateKB971513ForIUIAutomation
2, you need to use an UIAutomationInitializerInThread object in a thread, see demos/uiautomation_in_thread.py
[2021-12-02 14:03:24,284] ERROR in app: Exception on /send_msg [POST]
Traceback (most recent call last):
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\flask\app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\flask\app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\flask\app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\flask\app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "E:\xla\runjian\python\stock-manage\app.py", line 11, in send_msg
wx.ChatWith(who)
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\wxauto\wxauto.py", line 185, in ChatWith
self.UiaAPI.SwitchToThisWindow()
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 7437, in SwitchToThisWindow
if self.IsTopLevel():
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 6765, in IsTopLevel
handle = self.NativeWindowHandle
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 6094, in NativeWindowHandle
handle = self.Element.CurrentNativeWindowHandle
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 6218, in Element
self.Refind(maxSearchSeconds=TIME_OUT_SECOND, searchIntervalSeconds=self.searchInterval)
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 6466, in Refind
if not self.Exists(maxSearchSeconds, searchIntervalSeconds, False if raiseException else DEBUG_EXIST_DISAPPEAR):
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 6416, in Exists
control = FindControl(self.searchFromControl, self._CompareFunction, self.searchDepth, False, self.foundIndex)
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 8315, in FindControl
control = GetRootControl()
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 8093, in GetRootControl
return Control.CreateControlFromElement(AutomationClient.instance().IUIAutomation.GetRootElement())
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 52, in instance
cls.instance = cls()
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 69, in init
raise ex
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 60, in init
self.IUIAutomation = comtypes.client.CreateObject("{ff48dba4-60ef-4201-aa87-54103eef594e}", interface=self.UIAutomationCore.IUIAutomation)
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\comtypes\client_init
.py", line 238, in CreateObject
obj = comtypes.CoCreateInstance(clsid, clsctx=clsctx, interface=interface)
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\comtypes_init
.py", line 1219, in CoCreateInstance
_ole32.CoCreateInstance(byref(clsid), punkouter, clsctx, byref(iid), byref(p))
File "_ctypes/callproc.c", line 922, in GetResult
OSError: [WinError -2147221008] 尚未调用 CoInitialize。

代码疑似bug?? ChatWith(self, who, RollTimes=None):

def ChatWith(self, who, RollTimes=None):
    '''
    打开某个聊天框
    who : 要打开的聊天框好友名,str;  * 最好完整匹配,不完全匹配只会选取搜索框第一个
    RollTimes : 默认向下滚动多少次,再进行搜索
    '''
    self.UiaAPI.SwitchToThisWindow()
    RollTimes = 10 if not RollTimes else RollTimes
    RollTimes = 0

RollTimes入参给0 不想再最近联系人列表搜索
但是 if not 0 = True , RollTimes又被赋值10 还是在最近联系人列表查找了

wxauto反馈

窗口自动弹出后失效

我在使用过程中发现偶尔会将对话的窗口从微信主窗口中单独拖出来,导致后续无法发送信息;
是否可以添加一个发送信息完成后关闭对话框的操作(无论是主窗口还是偶尔打开的独立对话窗口),来避开这个问题

关于给服务号发消息

给微信公众号的服务号发消息时候,因为服务号默认初始页面不是消息输入框,就会报错发送失败,有办法破没?
另外貌似无法唤醒缩小到右下角只剩下一个图标的微信,win19x64 wx 3.3.5.50

机器人发送“{”字符时报错,如 ${城市}

Traceback (most recent call last):
File "C:/Users/Administrator/Desktop/wxauto-main/main.py", line 210, in
wx.SendMsg(message)
File "C:\Users\Administrator\Desktop\wxauto-main\utils\wxauto.py", line 209, in SendMsg
self.EditMsg.SendKeys(msg, waitTime=0)
File "C:\Users\Administrator\Desktop\wxauto-main\venv\lib\site-packages\uiautomation\uiautomation.py", line 6740, in SendKeys
SendKeys(text, interval, waitTime, charMode)
File "C:\Users\Administrator\Desktop\wxauto-main\venv\lib\site-packages\uiautomation\uiautomation.py", line 2790, in SendKeys
SendUnicodeChar(key[0], charMode)
File "C:\Users\Administrator\Desktop\wxauto-main\venv\lib\site-packages\uiautomation\uiautomation.py", line 2587, in SendUnicodeChar
scan = ord(char)
TypeError: ord() expected a character, but string of length 3 found

适配最新版本3.7.5的微信

""" 添加pasteType="0" 最新3.7.5版本的适配 """
copydata = COPYDICT[i].replace(b'', key.encode()).replace(b'type="0"',
b'type="3"')

请问大佬可不可以监听微信群最新消息呢

比如实时监听某个微信群最新消息, 如果消息中出现了某个关键词就发出提醒
from wxauto import *
wx = WeChat()
msgs = wx.GetLastMessage
while True:
if msgs == wx.GetLastMessage:
continue
else:
msgs = wx.GetLastMessage
# 后续对最新msgs进行处理
# ...

不知道这样写可不可以, 还是有更好的监听函数可以直接调用呢, 请大佬教我

[feature request]获取公众号所有文章链接

windows客户端点选已关注公众号后,可以看到文章总数
滑动滚轮即可不断刷新文章
我看了下代码 是不是可以直接改造这个

    def getArticles(self, who, RollTimes=None):
        '''
        打开某个聊天框
        who : 要打开的聊天框好友名,str;  * 最好完整匹配,不完全匹配只会选取搜索框第一个
        RollTimes : 默认向下滚动多少次,再进行搜索
        '''
        self.UiaAPI.SwitchToThisWindow()
        RollTimes = 10 if not RollTimes else RollTimes
        def roll_to(who=who, RollTimes=RollTimes):
            for i in range(RollTimes):
                if who not in self.GetSessionList()[:-1]:
                    self.SessionList.WheelDown(wheelTimes=3, waitTime=0.1*i)
                else:
                    time.sleep(0.5)
                    self.SessionList.ListItemControl(Name=who).Click(simulateMove=False)
                    return 1
            return 0
        rollresult = roll_to()
        if rollresult:
            return 1
        else:
            self.Search(“订阅号”)
            return roll_to(RollTimes=1)

按照咱定义的roll方法 把“订阅号”当成chatwith里的who,roll应该是可以选中的,然后就是要再其中search 具体公众号名称,然后选中,又是一波滚动,文章没有的话,这个滚轮是动不了的,最后就是把文章名称 发布时间 link拿到
WeChat_xAMVeR6OyL

@cluic

远程桌面运行还有一些问题

你好,我遇到了以下问题:
from wxauto import *
to_user = 'TEST'
msg = 'hello'
wx = WeChat()
wx.ChatWith(to_user)
wx.SendMsg(msg)

  1. 直接运行可以正常发送
  2. 计划任务运行无法找到窗体,(141) : Find Control Timeout: {ClassName: 'WeChatMainWndForPC', ControlType: WindowControl}(<class 'LookupError'>)
  3. 远程桌面运行,远程桌面打开窗口或者最大化的时候可以运行,远程桌面最小化或者关闭不能正常发送,管理员权限运行也不能解决这个问题

下面是错误日志:
2021-09-10 19:15:31.645 wxauto.py[210] SendMsg -> 2021-09-10 19:15:32.432 wxauto.py[193] roll_to -> Can not move cursor. ListItemControl's BoundingRectangle is (0,0,0,0)[0x0]. SearchProperties: {Name: 'TEST', ControlType: ListItemControl}
2021-09-10 19:15:43.033 wxauto.py[210] SendMsg -> Find Control Timeout: {Name: '输入', ControlType: EditControl}
2021-09-10 19:15:33.051 wxauto.py[193] roll_to -> Can not move cursor. ListItemControl's BoundingRectangle is (0,0,0,0)[0x0]. SearchProperties: {Name: 'TEST', ControlType: ListItemControl}
2021-09-10 19:15:43.589 wxauto.py[210] SendMsg -> Find Control Timeout: {Name: '输入', ControlType: EditControl}
2021-09-10 19:15:44.476 wxauto.py[193] roll_to -> Can not move cursor. ListItemControl's BoundingRectangle is (0,0,0,0)[0x0]. SearchProperties: {Name: 'TEST', ControlType: ListItemControl}
2021-09-10 19:15:55.037 wxauto.py[210] SendMsg -> Find Control Timeout: {Name: '输入', ControlType: EditControl}
2021-09-10 19:15:45.001 wxauto.py[193] roll_to -> Can not move cursor. ListItemControl's BoundingRectangle is (0,0,0,0)[0x0]. SearchProperties: {Name: 'TEST', ControlType: ListItemControl}
2021-09-10 19:15:55.579 wxauto.py[210] SendMsg -> Find Control Timeout: {Name: '输入', ControlType: EditControl}
2021-09-10 19:15:56.468 wxauto.py[193] roll_to -> Can not move cursor. ListItemControl's BoundingRectangle is (0,0,0,0)[0x0]. SearchProperties: {Name: 'TEST', ControlType: ListItemControl}
2021-09-10 19:16:07.052 wxauto.py[210] SendMsg -> Find Control Timeout: {Name: '输入', ControlType: EditControl}
2021-09-10 19:15:56.986 wxauto.py[193] roll_to -> Can not move cursor. ListItemControl's BoundingRectangle is (0,0,0,0)[0x0]. SearchProperties: {Name: 'TEST', ControlType: ListItemControl}
2021-09-10 19:16:07.563 wxauto.py[210] SendMsg -> Find Control Timeout: {Name: '输入', ControlType: EditControl}
2021-09-10 19:16:08.952 wxauto.py[193] roll_to -> Can not move cursor. ListItemControl's BoundingRectangle is (0,0,0,0)[0x0]. SearchProperties: {Name: 'TEST', ControlType: ListItemControl}
2021-09-10 19:16:19.523 wxauto.py[210] SendMsg -> Find Control Timeout: {Name: '输入', ControlType: EditControl}
2021-09-10 19:16:21.103 wxauto.py[193] roll_to -> Can not move cursor. ListItemControl's BoundingRectangle is (0,0,0,0)[0x0]. SearchProperties: {Name: 'TEST', ControlType: ListItemControl}
2021-09-10 19:16:31.683 wxauto.py[210] SendMsg -> Find Control Timeout: {Name: '输入', ControlType: EditControl}
2021-09-10 19:16:33.901 wxauto.py[193] roll_to -> Can not move cursor. ListItemControl's BoundingRectangle is (0,0,0,0)[0x0]. SearchProperties: {Name: 'TEST', ControlType: ListItemControl}
2021-09-10 19:16:44.501 wxauto.py[210] SendMsg -> Find Control Timeout: {Name: '输入', ControlType: EditControl}

一个很奇葩的错误

找微信用户的时候,会出现翻过页的情况,一旦翻过页,程序认为已找到用户,但是又点击不到用户,就直接报错退出了

请问程序在给几个人发送了信息后就报错了,该如何解决

尊敬的开发者,你好,我在用wxauto库来提醒他人进行疫情登记时,程序总是在发送前几个人的信息后就不再寻找聊天框了,接着就停止报错了,想请问一下如何解决这个问题。
代码:
from configparser import LegacyInterpolation
from wxauto import *
import time

wx = WeChat()
wx.GetSessionList()

leng=["张伟林","郑昊东","夏槟","郑剑锋","陈鹏理","范新森","罗鹏","邱斌","黄孝鹏","洪宇","吴昊彬",]

for i in leng:
msg = '1'
who = i

wx.ChatWith(who)
wx.SendMsg(msg)
报错:
Traceback (most recent call last):
File "d:/爬虫框架/120.py", line 20, in
wx.ChatWith(who) # 打开文件传输助手聊天窗口
File "D:\anaconda3\lib\site-packages\wxauto\wxauto.py", line 196, in ChatWith
rollresult = roll_to()
File "D:\anaconda3\lib\site-packages\wxauto\wxauto.py", line 193, in roll_to
self.SessionList.ListItemControl(Name=who).Click(simulateMove=False)
File "D:\anaconda3\lib\site-packages\uiautomation\uiautomation.py", line 6542, in Click
point = self.MoveCursorToInnerPos(x, y, ratioX, ratioY, simulateMove)
File "D:\anaconda3\lib\site-packages\uiautomation\uiautomation.py", line 6503, in MoveCursorToInnerPos
rect = self.BoundingRectangle
File "D:\anaconda3\lib\site-packages\uiautomation\uiautomation.py", line 5906, in BoundingRectangle
rect = self.Element.CurrentBoundingRectangle
File "D:\anaconda3\lib\site-packages\uiautomation\uiautomation.py", line 6220, in Element
self.Refind(maxSearchSeconds=TIME_OUT_SECOND, searchIntervalSeconds=self.searchInterval)
File "D:\anaconda3\lib\site-packages\uiautomation\uiautomation.py", line 6471, in Refind
raise LookupError('Find Control Timeout({}s): {}'.format(maxSearchSeconds, self.GetSearchPropertiesStr()))
LookupError: Find Control Timeout(10s): {Name: '陈鹏理', ControlType: ListItemControl}

操作时有很多报错

查sessionlist、发消息 功能可以工作了。但有很多报错:
2022-08-16 11:34:18.984 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-16 11:34:19.264 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}
2022-08-16 11:34:19.548 wxauto.py[48] SplitMessage -> Find Control Timeout(0s): {ControlType: ButtonControl}

GetAllMessage TypeError

GetAllMessage() returned a TypeError that "list_object_is_not_callable"
But there is not list type params I entered, who so?
Is it my input fault or bug
GetAllMessage_TypeError_list_object_is_not_callable
?

还有没有更好的方式获取微信号,目前我是这样获取的

win = uia.WindowControl(ClassName='WeChatMainWndForPC')

获取当前登陆的微信昵称

nick_name_button = win.ButtonControl()
nick_name = nick_name_button.Name
if nick_name is None or nick_name == '':
print('获取当前微信昵称时发生异常!')
return None
print('正在同步微信用户昵称为【{}】的系统数据...'.format(nick_name))

尝试获取当前登陆的微信号

try:
if not win.IsTopmost():
win.SetActive()
win.SetTopmost(True)
nick_name_button.Click()
wechat_id_editor = win.GetFirstChildControl().GetFirstChildControl().GetNextSiblingControl().GetFirstChildControl().GetFirstChildControl().GetFirstChildControl().GetFirstChildControl().GetNextSiblingControl().GetLastChildControl()
wechat_id = wechat_id_editor.Name
except Exception as e:
print('获取当前微信号发生异常:{}'.format(e))
else:
print('当前微信号为:{}'.format(wechat_id))

微信发送文件时失败

微信发送文件时失败:提示'0'是一个空文件,无法发送,请重新选择!文件路径都是正确,发送消息框内容为空

转发功能

您好!非常感谢您做的这个pj,我在实际使用的过程中遇到了一些小问题,就是关于想要转发视频号的问题。我在使用过程中如果想要转发图片之类可以通过获取信息然后赋予变量的方式进行转发,但是视频号我在获取信息的时候返回的是一段数字,我在转发的时候就只能发送数字而无法发送视频了,所以想问一下能否进行进一步的交流?或者说您有没有可以解决的办法或者方案呢?再次感谢您的pj为我节省了许多的时间!

微信后台运行时,无法发送消息

微信后台运行时,无法发送消息,可以添加以下代码先把微信调到前台。

import subprocess
subprocess.Popen('C:\Program Files (x86)\Tencent\WeChat\WeChat.exe')

时间问题

请问支持时间检索吗,例如我获取十分钟的微信聊天记录

No module named "win32gui"

Try to use wxauto.py file directly and install the required packages manually, but meet a no module named 'win32gui' problem.

I have tried to install win32gui with the command pip install win32gui, but failed.

The alternative way is pip install pywin32

The latest win32gui was released on Aug 16, 2017, some features may not be compatible with Python 3.7+.

SendMsg里的文字格式怎么修改啊

text = “””通知:
疫情形势
公告
”””
wx.SendMsg(text)

就这种情况发出去的内容是连在一块儿的

通知:疫情形势公告

最新版微信无法发送文件

copydata = COPYDICT[i].replace(b'<EditElement type="0"><![CDATA[ ]]>', key.encode()).replace(b'type="0"', b'type="3"')

改为
copydata = COPYDICT[i].replace(b'<EditElement type="0" pasteType="0"><![CDATA[ ]]>', key.encode()).replace(b'type="0"', b'type="3"')

相关问题提问

您好 我想咨询一下 如果现在微信更新版本 这个代码还能用吗?
还有 每次发送消息都会弹出微信 可以不弹出吗?

如何获得消息中的图片?

消息如果是图片的话,输出是:【图片】,怎么才能得到真实的图片呢?我需要把图片发到文字识别api中。
不胜感激!

wxauto相关问题

尊敬的开发者,你好
我用的python3.10版本是不兼容现在的wxauto版本吗,为什么我程序循环定时发送信息,只能发几个人就抛异常,我也换了搜索方式也是一样的效果这是什么情况呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.