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

萍乡做网站哪家好期货网站做模拟

萍乡做网站哪家好,期货网站做模拟,浏览器网页视频下载,电子政务网站系统Python uiautomation 是一个用于自动化 GUI 测试和操作的库#xff0c;它可以模拟用户操作来执行各种任务。 通过这个库#xff0c;可以使用Python脚本模拟人工点击#xff0c;人工操作界面。本文使用 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微信, ClassNameWeChatMainWndForPC)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(titlenotification_title,messagenotification_message,app_nameWeChat)# 更新日志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_depth0):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微信收款助手, ClassNameChatWnd)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://www.sczhlp.com/news/191976/

相关文章:

  • 专业做学校网站的公司付费下载网站源码
  • 关键词优化排名查询北海网站优化
  • 爱站网 关键词挖掘工具站济南网签查询系统
  • 五一电子网站建设邯郸学校网站建设价格
  • 网站开发的运行可行性iapp源码网
  • 无锡网站制作选哪家wordpress 笑话模板
  • 苏州网站建设找哪家wordpress头像大小不一
  • 上海企业网站推广上海设计公司排名前十强20
  • wordpress数据库修复seo搜索优化费用
  • 网站建设公司正规吗建设工程抗震管理条例
  • 烟台高新区网站wordpress会员图片主题
  • 开发系统网站建设湖南建设厅官网平台
  • 案例学习网站建设方案wordpress清理修订
  • 枣庄市 网站建设上海专门做网站的公司
  • 网站域名在哪里申请wordpress批量读取excel
  • 网站怎么制作成二维码邢台哪里有做网站的
  • 柳州网站建站费用深圳10大品牌策划公司
  • 网站服务器用什么好处微网站特效
  • 南宁网站建设云尚网络知名景观设计公司的官网
  • 二手书的网站建设还是正式公司好
  • 北京自适应网站建设网页广告调词平台
  • 乌兰察布市建设工程造价网站前端开发学什么
  • 20232419 2025-2026-1《网络与系统攻防技术》实验一实验报告
  • 完整教程:用deepseek部署全自动的机器人--bytebot
  • 三剑客系列-sed命令
  • 鸿川建设工程有限公司官方网站可以直接进入的正能量网站
  • 免费域名网站创建wordpress积分墙
  • 网站的建立步骤365建筑人才网
  • 网站制作一般要几天海南网页设计
  • 有哪些可以做头像的网站内部网站建设拓扑