import wget for i in range(0, 200): URL = "http://192.168.1.121/hist/"+ "history"+str(i) print(URL) try: response = wget.download(URL) except: print("An exception occurred") print("end")