循环访问web

 1 # -*- coding: utf-8 -*-
 2 import requests
 3 import time
 4 
 5 url_pre = "http://xxxxx/"
 6 
 7 list = [82620472, 82589504, 82584718, 82555344, 82528003, 82526621, 82428457, 82355638, 82355330, 82355330,
 8         82343369, 82178091, 82153197, 82077644, 82077551, 82023972, 82019167, 82017912, 81986374, 81986018,
 9         81985288, 81974371, 81974148, 81974016, 81951756, 81951049, 81780459, 81780152, 81779993, 81779056,
10         81778791, 81778173, 81777569, 81739856, 81629332, 81623546, 81587920, 81567732, 81543990, 81537971,
11         81513128, 81474963, 81474845, 81474803, 81474683, 81474524, 81474424, 81450180, 81449928, 81449739,
12         81449595, 81449523, 81449067, 81428522, 81428432, 81428347, 81428067, 81428052, 81427991, 81427815,
13         81427744, 81415208, 81414892, 81409938, 81409874, 81409768, 81409717, 81409609, 81409508, 81408510,
14         81866096, 81474988, 81474865, 81450567, 81450029, 81449258, 81428187, 81449446]
15 j = 0
16 while True:
17 
18     for index, i in enumerate(list):
19         print(index, end=" ", flush=True)
20         requests.get(url_pre + str(i))
21         time.sleep(1)
22 
23     j += 1
24     print("  ", j, "次循环访问已完成")

 

posted on 2019-04-02 15:55  明.Sir  阅读(150)  评论(0编辑  收藏  举报

导航