Sep-01-2021, 08:07 AM
You might can use a try except clause. Something like. Code not tested.
#! /usr/bin/env python3 import requests as rq import random as rnd import copy url = 'testurl.com' proxy_list = ['173.68.59.131:3128','64.124.38.139:8080','69.197.181.202:3128'] proxy_copy = copy.deepcopy(proxy_list) while proxy_copy: rnd.shuffle(proxy_copy) proxy = proxy_copy.pop() try: response = rq.get(url, headers=headers, proxies={'https':proxy}, timeout=3) print(response.status_code) except NameError as error: print(error) continue
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags