前言

​ 读大学的表弟因为太勤快不想手动刷某通阅读叫我帮写个代码出来给他用,这不来了嘛。我记得

greasyfork网站不是有吗?

Python
1
正常写会报错,try一下就行。大致就是这样有其他需求可以调
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import pyautogui
import random

img_src = ('nextpage.png') #可以先截屏
sleep_time = random.randint(1, 5) #随机时间
def find_image():
pyautogui.sleep(sleep_time)
click = pyautogui.locateOnScreen(img_src, confidence=0.9) #查找图片
center = pyautogui.center(click) # 查找图片中心
pyautogui.click(center)
print('点击')
while True:
try:
click = pyautogui.locateOnScreen(img_src, confidence=0.9)
if click:
find_image() # 调用函数
except Exception as e:
pyautogui.sleep(sleep_time)
scroll_amount = random.randint(-200, -150) # 在范围值随机下移
pyautogui.scroll(scroll_amount)
print('下移')