#!/usr/bin/env python
import os
import time
from PIL import ImageGrab
path = r"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
urls = open(r"C:\Users\Root\Desktop\URL.txt").readlines()
for i in range(30):
urls[i] = urls[i][0: -1]
cur = 6
img1 = ImageGrab.grab()
time.sleep(3)
while cur < 30:
img2 = ImageGrab.grab()
# 小弹窗已出现,屏幕已静止不动。
if img1 == img2:
cmd = "\"{}\" \"{}\"".format(path, urls[cur])
# os.system(cmd)
print(cmd)
cur = cur + 1
else:
img1 = img2
time.sleep(3)