对剪切板的失控异常的处理---多半的时间再处理剪切板的失控---冗余操作
对剪切板的失控异常的处理---多半的时间再处理剪切板的失控---冗余操作
import time
import win32gui, win32ui, win32con, win32api
from PIL import Image
import pytesseract
import os
qqu, qqp = ('25', 'h2020')
win_p=(1714,942)
# 将app窗口置为当前窗口,等效点,选3个,点击
time.sleep(6)
l = [(15, 81), (23, 120), (22, 126)]
for i in l:
x, y = i
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
#登陆口qq
qqx, qqy = (358, 239)
x,y=qqx,qqy
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
time.sleep(10)
import win32clipboard
qqu_p, qqp_p=(93,347),(151,447)
#点击账号输入区,调出搜狗输入法app
x,y=qqu_p
for i in range(20):
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
# time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
time.sleep(0.5)
print(i)
time.sleep(10)
for i in range(3):
x,y=win_p
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
time.sleep(1)
#剪切板内容赋值
for i in range(10):
win32clipboard.OpenClipboard()
# win32clipboard.EmptyClipboard()
ms =qqu
win32clipboard.SetClipboardData(win32con.CF_UNICODETEXT, '')
win32clipboard.SetClipboardData(win32con.CF_UNICODETEXT, ms)
cs = win32clipboard.GetClipboardData(win32con.CF_UNICODETEXT)
print(i,cs)
time.sleep(1)
try:
win32clipboard.CloseClipboard()
except Exception as e:
print(e)
# 将app窗口置为当前窗口,等效点,选3个,点击
time.sleep(6)
l = [(15, 81), (23, 120), (22, 126)]
for i in l:
x, y = i
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
#剪切板内容赋值
for i in range(10):
win32clipboard.OpenClipboard()
# win32clipboard.EmptyClipboard()
ms =qqu
win32clipboard.SetClipboardData(win32con.CF_UNICODETEXT, '')
win32clipboard.SetClipboardData(win32con.CF_UNICODETEXT, ms)
cs = win32clipboard.GetClipboardData(win32con.CF_UNICODETEXT)
print(i,cs)
time.sleep(1)
try:
win32clipboard.CloseClipboard()
except Exception as e:
print(e)
time.sleep(20)
#搜搜输入法,输入至目标区
#复制-粘贴路径1
input_app_p=[(344,635),(463,793)]
#复制-粘贴路径2
input_app_pb=[(49,623),(497,979),(287,710)]
for i in input_app_pb:
x,y=i
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
time.sleep(30)
for i in range(3):
x,y=win_p
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
time.sleep(1)
time.sleep(10)
#剪切板内容赋值
for i in range(10):
win32clipboard.OpenClipboard()
# win32clipboard.EmptyClipboard()
ms =qqp
win32clipboard.SetClipboardData(win32con.CF_UNICODETEXT, '')
win32clipboard.SetClipboardData(win32con.CF_UNICODETEXT, ms)
cs = win32clipboard.GetClipboardData(win32con.CF_UNICODETEXT)
print(i,cs)
time.sleep(1)
try:
win32clipboard.CloseClipboard()
except Exception as e:
print(e)
time.sleep(20)
# 将app窗口置为当前窗口,等效点,选3个,点击
time.sleep(6)
l = [(15, 81), (23, 120), (22, 126)]
for i in l:
x, y = i
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
#剪切板内容赋值
for i in range(10):
win32clipboard.OpenClipboard()
# win32clipboard.EmptyClipboard()
ms =qqp
win32clipboard.SetClipboardData(win32con.CF_UNICODETEXT, '')
win32clipboard.SetClipboardData(win32con.CF_UNICODETEXT, ms)
cs = win32clipboard.GetClipboardData(win32con.CF_UNICODETEXT)
print(i,cs)
time.sleep(1)
try:
win32clipboard.CloseClipboard()
except Exception as e:
print(e)
x,y=qqp_p
for i in range(20):
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
# time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
time.sleep(0.5)
print(i)
#搜搜输入法,输入至目标区
#复制-粘贴路径1
input_app_p=[(344,635),(463,793)]
#复制-粘贴路径2
input_app_pb=[(49,623),(497,979),(287,710)]
for i in input_app_pb:
x,y=i
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
time.sleep(30)
time.sleep(10)
login_p=(217,537)
for i in range(3):
x,y=login_p
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)
time.sleep(10)
time.sleep(30)
os._exit(5435)