#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pyautogui
import time
def zan():
time.sleep(2.5) # 等待 0.5 秒
left, top, width, height = pyautogui.locateOnScreen('33.png') # 寻找 点赞图片;
center = pyautogui.center((left, top, width, height)) # 寻找 图片的中心
pyautogui.click(center) # 点击
print('点赞成功!')
while True:
if pyautogui.locateOnScreen('33.png'):
zan() # 调用点赞函数
else:
pyautogui.scroll(-10) # 本页没有图片后,滚动鼠标;
print('没有找到目标,屏幕下滚~')
查找图像点击位置
最新推荐文章于 2022-06-24 14:35:10 发布