将代码设置的剪切板内容通过输入法软件粘贴入app搜索框

#进入app搜索框位置--双击
#等待输入法软件弹出
#将代码设置的剪切板内容通过输入法软件粘贴入app搜索框
#搜索



import win32api
import time
import win32clipboard
import win32con

time.sleep(5)

# 进入app搜索框位置--双击
# 等待输入法软件弹出
# 将代码设置的剪切板内容通过输入法软件粘贴入app搜索框
# 搜索

x, y = 228, 160
time.sleep(2)
win32api.SetCursorPos([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)
time.sleep(2)
win32clipboard.OpenClipboard()
time.sleep(0.05)
win32clipboard.EmptyClipboard()
time.sleep(0.05)
win32clipboard.CloseClipboard()
time.sleep(0.05)

win32clipboard.OpenClipboard()
ms = '2018楼市'
# 处理剪切板内容为win系统剪切板内容的异常
for i in range(3):
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardData(win32con.CF_UNICODETEXT, ms)

l = [(308, 675), (424, 825)]
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(4)

win32clipboard.CloseClipboard()

x, y = 485, 158
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)

dwData = -200
for i in range(12):
dwData -= 20
y += 200
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_WHEEL, x, y, dwData, 0)
time.sleep(3)
# 鼠标位置保持不变
y -= 200

x, y = 188, 480
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)





import win32api
import time
import win32clipboard
import win32con

time.sleep(5)

# 进入app搜索框位置--双击
# 等待输入法软件弹出
# 将代码设置的剪切板内容通过输入法软件粘贴入app搜索框
# 搜索

x, y = 228, 160
time.sleep(2)
win32api.SetCursorPos([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)
time.sleep(2)
for i in range(3):
win32clipboard.OpenClipboard()
time.sleep(0.05)
win32clipboard.EmptyClipboard()
time.sleep(0.05)
win32clipboard.CloseClipboard()
time.sleep(2)

win32clipboard.OpenClipboard()
ms = '2018楼市'
# 处理剪切板内容为win系统剪切板内容的异常
for i in range(3):
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardData(win32con.CF_UNICODETEXT, ms)

l = [(308, 675), (424, 825)]
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(4)

win32clipboard.CloseClipboard()

x, y = 485, 158
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)

dwData = -200
for i in range(12):
dwData -= 20
y += 200
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_WHEEL, x, y, dwData, 0)
time.sleep(3)
# 鼠标位置保持不变
y -= 200

x, y = 188, 480
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)

x, y = 494, 1017
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(6)
x, y = 70, 676
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(6)
l = [(308, 675), (424, 825)]
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(4)


x, y = 501, 152
win32api.SetCursorPos([x, y])
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
time.sleep(0.05)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)



评论内容写入;在主窗口搜索内容,对搜索结果,不进行判别的情况下,进行转发,并添加评论。





posted @ 2018-01-29 10:31  papering  阅读(432)  评论(0编辑  收藏  举报