動(dòng)態(tài)焦點(diǎn):#Uiautomation# 基于Uiautomation的微信自動(dòng)化
“文章所涉及內(nèi)容更多來自網(wǎng)絡(luò),在此聲明,并感謝知識(shí)的貢獻(xiàn)者!”
UI自動(dòng)化—UI編程包括但不限于UI界面的開發(fā),UI界面的測(cè)試。而本系列文章的主要側(cè)重于UI界面的自動(dòng)化操作。通過一段代碼實(shí)現(xiàn)電腦自行點(diǎn)擊、打開某文件或者修改某進(jìn)程的操作。
(資料圖)
—
UiSpy 下載
(23條消息) windows 技術(shù)篇 - uispy 工具獲取和使用,windows窗口屬性快捷查看工具_(dá)掙扎的藍(lán)藻的博客-CSDN博客_uispy
https://blog.csdn.net/qq_38161040/article/details/105491034
FlatUInspect 源碼下載
https://github.com/FlaUI/FlaUInspect
FlatUInspect編譯運(yùn)行
FlatUInspect 使用說明
https://zhuanlan.zhihu.com/p/563909940?utm_id=0
FlatUInspect 微信控件層次
控件識(shí)別工具Inspect.exe下載
https://www.shuzhiduo.com/A/6pdDZNkDJw/
Window Inspector 下載
https://www.jb51.net/softs/457644.html
locale庫(kù)—
import locale
#獲取系統(tǒng)語言
if (locale.getdefaultlocale()[0] =="zh_CN"):
pass
subprocess庫(kù)—
啟動(dòng)程序
import subprocess
subprocess.Popen("3dmark-setup.exe")
Uiautomation庫(kù)—
查找物件:
1、WindowContrl(searchDepth,ClassName,SubName) 查找窗口中的程序,如果有中文則需用Unicode;可用window.Exists(maxSearchSeconds)來判斷此窗口是否存在;
2、EditControl(searchFromControl) 查找編輯位置,找到后可用DoubleClick()來改變電腦的focus;edit.SetValue("string")輸入值;
3、MenuItemControl(searchFromControl,Name) 查找菜單按鈕;
4、ComboBoxControl(searchFromControl,AutomationI) 查找下拉框,然后在此基礎(chǔ)上用Select("name")方法來選擇需要的選項(xiàng);
5、BottonControl(searchFromControl,Name,SubName) 查找按鈕;
6、automation.FindControl(firefoxWindow,
lambdac:(isinstance(c, automation.EditControl) or isinstance(c,automation.ComboBoxControl)) and c.Name == "Enter your search term") 按條件搜索handle
點(diǎn)擊操作:
單擊:.Click()
雙擊:.DoubleClick()
Click() 點(diǎn)擊;
RighClik() 右鍵點(diǎn)擊;
DoubleClick()
SendKeys() 發(fā)送字符;
SetValue() 傳值,一般對(duì)EditControl用;
Win32API.SendKeys("string") 如果已在編輯位置,則可用此方法來輸入值,{Ctrl}為ctrl鍵,其他類似;{@ 8}格式可輸入8個(gè)@,對(duì)于數(shù)字也可實(shí)現(xiàn)此功能,但對(duì)于字母不能...;
切換窗口
import uiautomation as auto
window=auto.WindowControl(ClassName="CabinetWClass",searchDepth=1) #控制面板窗口
window.SwitchToThisWindow() # 切換窗口
窗口最大化:
window =auto.WindowControl(ClassName="CabinetWClass", searchDepth=1)
window.Maximize()
窗口操作
subprocess.Popen("Name") 用進(jìn)程打開程序;
window.Close() 關(guān)閉窗口;
window.SetActive() 使用;
window.SetTopMost() 設(shè)置為頂層
window.ShowWindow(uiautomation.ShowWindow.Maximize) 窗口最大化
window.CaptureToImage("Notepad.png") 截圖;
uiautomation.Win32API.PressKey(uiautomation.Keys.VK_CONTROL) 按住Ctrl鍵
uiautomation.Win32API.ReleaseKey(uiautomation.Keys.VK_CONTROL)釋放Ctrl鍵
automation.GetConsoleWindow() #return console window that runs python,打開控制臺(tái)
automation.Logger.ColorfulWriteLine("\nIwill open
automation.ShowDesktop() 顯示桌面;
微信自動(dòng)化—
獲取好友列表
https://zhuanlan.zhihu.com/p/474166048
獲取微信好友名單,可指定標(biāo)簽 & 全部
https://gitcode.net/mirrors/Frica01/Wechat_mass_msg?utm_source=csdn_github_accelerator
微信好友列表獲取(存儲(chǔ)到txt中)
https://blog.csdn.net/m0_67391377/article/details/126065428
python基于pywinauto實(shí)現(xiàn)PC端自動(dòng)化 python操作微信自動(dòng)化
https://blog.51cto.com/u_15354476/3767938
微信群發(fā)消息,獲取群通訊錄名單
https://www.fdsml.com/zh/438398.html
Python 實(shí)現(xiàn)獲取微信好友信息
https://www.cnblogs.com/swjian/p/10597690.html
微信好友列表獲取
https://www.pudn.com/news/62e3f4b5864d5c73ac26b03a.html
自動(dòng)發(fā)送微信消息
參考資料—
(23條消息) Python UI自動(dòng)化 編程(一) UIAutomation_OKKLES的博客-CSDN博客_uiautomation
https://blog.csdn.net/weixin_43393800/article/details/119105108
Python使用uiautomation實(shí)現(xiàn)Windows平臺(tái)自動(dòng)化 - ooops! - 博客園 (cnblogs.com)
https://www.cnblogs.com/jyang/p/11679828.html
(23條消息) python UIAutomator2使用教程_Jepson2017的博客-CSDN博客_uiautomator2
https://blog.csdn.net/d1240673769/article/details/113809889
開源自己用python封裝的一個(gè)Windows GUI(UIAutomation)自動(dòng)化工具,支持MFC,WindowsForms,WPF,Metro,Qt - YinKaisheng - 博客園 (cnblogs.com)
https://www.cnblogs.com/Yinkaisheng/p/3444132.html
桌面應(yīng)用自動(dòng)化python——uiautomation API 如何找元素 - 白灰 - 博客園 (cnblogs.com)
https://www.cnblogs.com/baihuitestsoftware/articles/9340462.html
UIAutomation使用(一) -蝸牛學(xué)苑 (woniuxy.cn)
https://www.woniuxy.cn/article/253
用開源uiautomation自動(dòng)化操作火狐 - 知乎 (zhihu.com)
https://zhuanlan.zhihu.com/p/30409594
Python下編寫Windows自動(dòng)化測(cè)試軟件 - 簡(jiǎn)書 (jianshu.com)
https://www.jianshu.com/p/be3c46c7a905
python:獲取微信好友列表信息(二)進(jìn)行導(dǎo)出微信好友到csv數(shù)據(jù)讀取與處理
https://blog.csdn.net/seoyundu/article/details/81543756
關(guān)鍵詞: 好友列表 切換窗口 自動(dòng)化操作
相關(guān)閱讀
-
動(dòng)態(tài)焦點(diǎn):#Uiautomation# 基于Uiautoma...
“文章所涉及內(nèi)容更多來自網(wǎng)絡(luò),在此聲明,并感謝知識(shí)的貢獻(xiàn)者!”U... -
世界百事通!chinanet怎么用(chinanet怎么用)
1、尊敬的電信用戶,您好!根據(jù)您的描述,如果您處于中國(guó)電信wifi熱... -
全球微資訊!龍龍直播tv版apk下載(龍龍...
大家好,小豆豆來為大家解答以上的問題。龍龍直播tv版apk下載,龍龍... -
世界最資訊丨瑞典因違反被遺忘權(quán)法而對(duì)G...
你需要知道的:瑞典數(shù)據(jù)保護(hù)局因違反被遺忘權(quán)法,對(duì)谷歌處以7500萬... -
A股91只個(gè)股出現(xiàn)大宗交易,藥明康德、光...
A股91只個(gè)股出現(xiàn)大宗交易,藥明康德、光啟技術(shù)、納微科技成交額居前 -
速訊:ST金洲:公司股票可能存在因股價(jià)...
ST金洲:公司股票可能存在因股價(jià)低于面值而終止上市風(fēng)險(xiǎn) -
熱點(diǎn)在線丨鄭眼看盤:A股縮量微升 還在...
鄭眼看盤:A股縮量微升還在等待更好時(shí)機(jī) -
linux命令tar使用方法(linux命令tar)
1、tar[-j|-z][cv][-f建立的檔案名]filename 《==打包與壓縮ta... -
怎樣減肥快(怎樣減肥快)
1、你可以試一下黑米減肥法。2、我在告訴你一個(gè)公式:3000卡=1克脂... -
快訊:Google與阿迪達(dá)斯合作推出新的智...
你需要知道的:Google,阿迪達(dá)斯和EA攜手推出了一款智能鞋墊,可以... -
【全球市場(chǎng)晚報(bào)】1月12日
【全球市場(chǎng)晚報(bào)】1月12日 -
“乙類乙管”后社區(qū)工作仍忙 代表呼吁...
市人大代表、靜安區(qū)彭浦新村街道黨工委書記任偉呼吁,優(yōu)化完善社區(qū)... -
10萬現(xiàn)金放進(jìn)上海華山醫(yī)院掛號(hào)處,好心...
1月10日,華山醫(yī)院掛號(hào)處一位患者扔下一黑色塑料袋后迅速離開。工作... -
環(huán)球關(guān)注:“取消體育中考建議”出自身...
市人代會(huì)12日聽取和審議人大常委會(huì)工作報(bào)告。施政代表認(rèn)為,當(dāng)代年... -
焦點(diǎn)消息!北京科學(xué)中心數(shù)百項(xiàng)公益活動(dòng)...
人民網(wǎng)北京1月12日電(記者趙竹青)記者從北京科學(xué)中心獲悉,為豐富... -
世界聚焦:過境小兵(過境貿(mào)易)
1、直接貿(mào)易、間接貿(mào)易、過境貿(mào)易有2點(diǎn)不同:一、三者的概述不同:... -
環(huán)球聚焦:一枝春紅燒五花肉百度云(一...
1、材料主料:五花肉500克調(diào)料:食鹽1茶匙,醬油1湯匙,冰糖20克,... -
每日焦點(diǎn)!風(fēng)雨同路光良(風(fēng)雨同路 光良)
1、光良-風(fēng)雨同路并著肩迎接著挑戰(zhàn)貢獻(xiàn)彼此淚和汗從不偽裝不要害怕... -
殲20將飛進(jìn)A股!千億戰(zhàn)斗機(jī)龍頭欲借殼中...
殲20將飛進(jìn)A股!千億戰(zhàn)斗機(jī)龍頭欲借殼中航電測(cè),股民:沒有50個(gè)板不賣 -
全球動(dòng)態(tài):2022年我國(guó)“三箭齊發(fā)” 保持...
國(guó)家發(fā)展改革委12日舉行2023年首場(chǎng)新聞發(fā)布會(huì),發(fā)布會(huì)上,國(guó)家發(fā)展...