1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import
os
import
time
import
webbrowser as web
import
random
count =
random.randint( 20 , 40 )
j =
0
while
j < count:
i =
0
while
i < =
5 :
i =
i +
1
time.sleep( 1 ) #浏览器暂停1秒
else :
os.system( ‘killall firefox‘ ) #关闭浏览器
j =
j +
1
print
j, ‘times closing Browser!‘
|