当前位置 : 主页 > 编程语言 > python >

pyautogui验证滑块

来源:互联网 收集:自由互联 发布时间:2022-07-02
import pyautogui import os import time pyautogui.FAILSAFE = False Path = "C:\Program Files (x86)\Tencent\QQ\Bin\QQScLauncher.exe" os.startfile(Path) time.sleep(6) account = "xxx" password = "xxxxxx" # 移到登录框输入账号的地方,单
import pyautogui
import os
import time
pyautogui.FAILSAFE = False
Path = "C:\Program Files (x86)\Tencent\QQ\Bin\QQScLauncher.exe"
os.startfile(Path)
time.sleep(6)

account = "xxx"
password = "xxxxxx"
# 移到登录框输入账号的地方,单击
pyautogui.moveTo(651, 398) (inspect工具定位元素坐标)
pyautogui.click()
time.sleep(0.2)
pyautogui.press("backspace")
pyautogui.typewrite(message=account, interval=0.25)
time.sleep(1)


# 移到密码框 清空密码,输入新密码
pyautogui.moveTo(733, 440)
pyautogui.click()
time.sleep(1)
for i in range(15):
pyautogui.press("backspace")

pyautogui.typewrite(message=password, interval=0.25)
pyautogui.moveTo(687, 514)
pyautogui.click()
time.sleep(5)

# add friend
pyautogui.moveTo(949,700)
pyautogui.click()

time.sleep(3)

qq = "xxxxxx"

for i in range(15):
pyautogui.press("backspace")

pyautogui.typewrite(message=qq, interval=0.25)
#点击搜索
pyautogui.moveTo(877, 181)
pyautogui.click()
time.sleep(2)
#点击加好友按钮
pyautogui.moveTo(361, 331)
pyautogui.click()
time.sleep(2)
#点击下一步
pyautogui.moveTo(790, 526)
pyautogui.click()
time.sleep(2)
pyautogui.click()
time.sleep(2)
# 再次点击下一步
pyautogui.moveTo(794, 523)
pyautogui.click()
time.sleep(2)

# 拖动滑块验证
pyautogui.moveTo(575, 488)
pyautogui.mouseDown(button='left')
pyautogui.mouseUp(button='left', x=780, y=488, duration=2.5)
pyautogui.click()
# 关闭完成按钮
pyautogui.moveTo(863, 527)
pyautogui.click()
print("添加消息已发送:" + "成功")
time.sleep(3)

# 安装pip install pyinstaller (用来生成.exe 可执行文件)
# pyinstaller -F main.py
上一篇:Python从门到精通(九):Grpc实现
下一篇:没有了
网友评论