my code doesn't repeat after a failed
import requests
with open("valid_proxies.txt", "r") as f:
proxies = f.read().split("\n")
sites_to_check = ["https://open.spotify.com/"]
counter = 1
for site in sites_to_check:
try:
print(f"Using the proxy: {proxies[counter]}")
res = requests.get(site, proxies={"http": proxies[counter],
"https": proxies[counter]})
print(res.status_code)
print(res.text)
except:
print("Failed")
finally:
counter += 10
You need another loop to try the same site with another proxy.