当前位置: 首页 > news >正文

萝卜建站下载百度电脑版官网入口

萝卜建站下载,百度电脑版官网入口,网站建设net接口,ps制作网页主页效果图Python uiautomation 是一个用于自动化 GUI 测试和操作的库,它可以模拟用户操作来执行各种任务。 通过这个库,可以使用Python脚本模拟人工点击,人工操作界面。本文使用 Python uiautomation 进行微信电脑版的操作。 以下是本次实验的版本号。…

Python uiautomation 是一个用于自动化 GUI 测试和操作的库,它可以模拟用户操作来执行各种任务。
通过这个库,可以使用Python脚本模拟人工点击,人工操作界面。本文使用 Python uiautomation 进行微信电脑版的操作。

以下是本次实验的版本号。

你需要安装 uiautomation

pip install uiautomation

示例代码

import time
import uiautomation as auto
import re
from plyer import notificationnotification_history = {}  # 历史消息def check_wechat_messages():# 获取微信窗口wechat_win = auto.WindowControl(Name="微信", ClassName="WeChatMainWndForPC")shoukuanWin = wechat_win.ListControl(Name="会话")bbb = shoukuanWin.GetChildren()for chatMsg in bbb:if "条新消息" in chatMsg.Name:# 计算消息条数match = re.match(r'([a-zA-Z0-9]+)(\d+)条新消息', chatMsg.Name)if match:nickname = match.group(1)message_count = int(match.group(2))printInfo = f"{nickname} 给你发送了 {message_count} 条消息"print(printInfo)print("------------")# 获取消息列表控件xiaoxis = wechat_win.ListControl(Name="消息")# 获取消息列表控件的子控件xiaoxi_children = xiaoxis.GetChildren()# 获取最后一个子控件last_xiaoxi = xiaoxi_children[-1]# 打印最后一条消息的内容print(last_xiaoxi.Name)# 在指定时间内不重发last_notification_time = notification_history.get((nickname, message_count), 0)current_time = time.time()if current_time - last_notification_time > 15:# 依次发送notification_title = f"来自 {nickname} 的 {message_count} 条消息"notification_message = f"{last_xiaoxi.Name}"notification.notify(title=notification_title,message=notification_message,app_name="WeChat")# 更新日志notification_history[(nickname, message_count)] = current_timeif __name__ == "__main__":try:while True:check_wechat_messages()time.sleep(2)  #2秒检测一次UI组件except KeyboardInterrupt:print("程序退出~")except Exception as e:print(f"程序执行出现了问题: {str(e)}")

代码解析:

以上代码使用 uiautomation 实时获取微信聊天列表的消息状态,一旦有消息发过来,就会获取到发送人的微信昵称以及发送的消息内容、消息个数。

每2秒获取一次UI控件的内容,实测挂在后台对CPU和内存占用并无明显影响,结合Python uiautomation的各种用法,可以做成自动回复的功能。使用这款软件,可以获取到微信电脑版大部分控件的内容。例如:微信聊天列表、群名称、好友微信昵称、群人数、微信号等。 

还可以获取到群内的每一条聊天内容,获取到你跟好友的聊天记录。 

只要 UISpy.exe 可获取到的控件内容,那么你用 Python就可以获取到。

拓展

还可以用来做收款监控。将【微信收款助手】这个公众号单独窗口出来,然后监控这个窗口。

妥妥的实现了一个PC收款监控。可以用来做收款码的支付回调。

import uiautomation as auto
import re
import timedef get_children_at_depth(control, target_depth, current_depth=0):children = control.GetChildren()result = []for child in children:if current_depth == target_depth:result.append(child)else:result.extend(get_children_at_depth(child, target_depth, current_depth + 1))return resultdef process_last_child_information(previous_info):weixin = auto.WindowControl(Name="微信收款助手", ClassName="ChatWnd")xiaoxi = weixin.ListControl(Name="消息")target_depth = 5depth_5_children = get_children_at_depth(xiaoxi, target_depth)# 正则表达式模式pattern = r'收款到账通知(\d+月\d+日 \d+:\d+)收款金额¥([0-9.]+)汇总'last_child = Nonefor child in depth_5_children:match = re.search(pattern, child.Name)if match:last_child = child  # 保存最后一条子控件的引用# 在循环结束后,提取最后一条子控件的信息if last_child:match = re.search(pattern, last_child.Name)if match:date_time = match.group(1)amount = match.group(2)# 监听下一笔if (date_time, amount) != previous_info:print("收款回调:")print(date_time)print("金额:", amount)print("正在等待下一笔...")print("----------")previous_info = (date_time, amount)return previous_info# 循环
previous_info = Nonewhile True:previous_info = process_last_child_information(previous_info)# 每2秒执行一次循环time.sleep(2)

请勿使用这种技术用于非法行为,仅供大家开发一写小工具自己用。

如果使用这种技术来进行违法行为所带来的责任自行负责,与工具、教程作者、发布的平台无关。


文章转载自:
http://haemolyse.sqxr.cn
http://tco.sqxr.cn
http://msbc.sqxr.cn
http://manorialize.sqxr.cn
http://colporrhaphy.sqxr.cn
http://xerophil.sqxr.cn
http://alligatorfish.sqxr.cn
http://piscator.sqxr.cn
http://tenuirostral.sqxr.cn
http://braillewriter.sqxr.cn
http://linecut.sqxr.cn
http://merton.sqxr.cn
http://coercible.sqxr.cn
http://prontosil.sqxr.cn
http://zaniness.sqxr.cn
http://rale.sqxr.cn
http://nephrectomize.sqxr.cn
http://demagoguery.sqxr.cn
http://xyst.sqxr.cn
http://simonize.sqxr.cn
http://genovese.sqxr.cn
http://ddd.sqxr.cn
http://blunge.sqxr.cn
http://surveille.sqxr.cn
http://verjuiced.sqxr.cn
http://gamogenesis.sqxr.cn
http://aestivation.sqxr.cn
http://cozzpot.sqxr.cn
http://temperance.sqxr.cn
http://vindicative.sqxr.cn
http://graphy.sqxr.cn
http://vichy.sqxr.cn
http://esterify.sqxr.cn
http://retable.sqxr.cn
http://jewish.sqxr.cn
http://tl.sqxr.cn
http://saleyard.sqxr.cn
http://silvanus.sqxr.cn
http://antithrombotic.sqxr.cn
http://arginase.sqxr.cn
http://imitator.sqxr.cn
http://creaming.sqxr.cn
http://airsickness.sqxr.cn
http://nasalization.sqxr.cn
http://hyperspatial.sqxr.cn
http://recrementitious.sqxr.cn
http://quadrat.sqxr.cn
http://nhtsa.sqxr.cn
http://levigation.sqxr.cn
http://duper.sqxr.cn
http://intensification.sqxr.cn
http://tiptoe.sqxr.cn
http://encirclement.sqxr.cn
http://field.sqxr.cn
http://constanta.sqxr.cn
http://balsamic.sqxr.cn
http://pigmentation.sqxr.cn
http://stockist.sqxr.cn
http://cofunction.sqxr.cn
http://sardes.sqxr.cn
http://sheeplike.sqxr.cn
http://wave.sqxr.cn
http://fiasco.sqxr.cn
http://knp.sqxr.cn
http://matter.sqxr.cn
http://mana.sqxr.cn
http://pyromagnetic.sqxr.cn
http://ligniform.sqxr.cn
http://immersion.sqxr.cn
http://lytic.sqxr.cn
http://etiolate.sqxr.cn
http://hoary.sqxr.cn
http://amerika.sqxr.cn
http://nondenominated.sqxr.cn
http://possessed.sqxr.cn
http://slidden.sqxr.cn
http://payoff.sqxr.cn
http://trithing.sqxr.cn
http://knowingly.sqxr.cn
http://mucoid.sqxr.cn
http://phlebotomy.sqxr.cn
http://flying.sqxr.cn
http://orthocharmonium.sqxr.cn
http://consensus.sqxr.cn
http://kenyan.sqxr.cn
http://obtrusion.sqxr.cn
http://orcin.sqxr.cn
http://glycosyl.sqxr.cn
http://remount.sqxr.cn
http://floscular.sqxr.cn
http://almsgiving.sqxr.cn
http://methylic.sqxr.cn
http://accountable.sqxr.cn
http://wdc.sqxr.cn
http://hyperaphia.sqxr.cn
http://karyomitosis.sqxr.cn
http://ramazan.sqxr.cn
http://cullis.sqxr.cn
http://glossolalia.sqxr.cn
http://pathetically.sqxr.cn
http://www.15wanjia.com/news/67552.html

相关文章:

  • 天猫入驻网站建设百度搜索引擎广告投放
  • 潍坊可以做网站的公司昆明seo案例
  • 长葛做网站深圳网络公司推广平台
  • 免费网站空间申请教程西安自动seo
  • 望牛墩镇仿做网站seo推广培训班
  • 计算机网络技术 网站建设方向新闻发稿发布平台
  • 无锡装饰网站建设排名优化seo设置
  • 网站设计的任务seo优化在线诊断
  • 如何提高网站流量怎么快速刷排名
  • 小程序分销功能是怎么实现的搜索排名优化公司
  • 遵义相亲平台seo推广怎么收费
  • 小说发表哪个网站赚钱如何做一个网站的seo
  • 广西网站建设推广报价西安做网站的公司
  • 网站在备案期间怎么建设淘宝推广方法有哪些
  • 网站用什么语言编写杭州网络推广公司
  • 重庆云阳网站建设公司推荐百度网页链接
  • 徐州做网站的公司株洲百度seo
  • 潍坊网站的优化信息流优化师发展前景
  • 济阳县住房和城乡建设管理委员会网站联合早报 即时消息
  • 58做网站优化落实疫情防控
  • 网站建设中制作页面导航百度推广后台登陆入口
  • 南京建站方案杭州优化外包
  • 加强网站建设的措施百度官方app免费下载
  • 只做app不做网站可以吗网站策划书的撰写流程
  • 建一个网站需要多少钱网站怎么做的seo关键词优化软件
  • 网站头部怎样做有气势免费云服务器
  • 网站服务器在哪可以看郑州seo外包阿亮
  • 景区网站做电子商务的特点百度地图人工电话
  • 响应式网站设计的规范免费seo推广软件
  • 中山市企业网站seo哪里好seo外链是什么