1.比较有趣,可以不断刷新指定的网址
2.源码:
#!/usr/bin/env python3
# -*- coding: utf-8 -*- import webbrowser as web
import time
import os
import random
count = random.randint(5,7)
j=0
while j<=count:
i=0
while i<=8 :
web.open_new_tab('https://www.baidu.com') #网址自己填入
i=i+1
time.sleep(0.8)
else:
os.system('taskkill /F /IM chrome.exe')
print(j,'time webbrower closed')
j=j+1