注:Windows版本:10+
Microsoft edge使用新版
python3.7,使用uiautomation
1.edge手势
如果你使用的是edge浏览器,那么手势可以增加你的使用效率,让你快速进行页面操作。
edge用户从这里:
edge://settings/mouseGesture
可以看到鼠标手势的配置。
像这样:
2.u模式输入和v模式输入
比如:
(撇+竖)
(木字旁+卯)
(单位)
比如:
(698)
(2016.8.9)
(6⁶+9986)
3.python微信消息关键字式自动回复
不建议过多使用、不建议回复长内容,有封号风险
from uiautomation import WindowControl
keyword_answers = [
("sb", "你也是"),
("名字", "Elan"),
("岁", "13"),
]
wx = WindowControl(Name='微信', searchDepth=1)
wx.SwitchToThisWindow()
hw = wx.ListControl(Name='会话')
def find_chapter_page(query):
for keyword, answer in keyword_answers:
if keyword in query:
return answer
return "听不懂思密达"
while True:
we = hw.TextControl(searchDepth=4)
while not we.Exists():
pass
if we.Name:
we.Click(simulateMove=False)
last_msg = wx.ListControl(Name='消息').GetChildren()[-1].Name
response = find_chapter_page(last_msg)
wx.SendKeys(response, waitTime=5)
wx.SendKeys('{Enter}', waitTime=1)
wx.TextControl(SubName=last_msg[:5]).Click()
代码比较简单,不做过多介绍,不会的评论区提问。
效果: