Answer the question
In order to leave comments, you need to log in
Python how to handle exception?
Tell me how to handle the exception
import requests
from proxy_list import runproxy
def check():
httproxy = {"http": "http://" + runproxy()}
request_handler = requests.get('http://www.yandex.ru', proxies=httproxy)
try:
check()
except Exception, e:
check()
Answer the question
In order to leave comments, you need to log in
def check():
httproxy = {"http": "http://" + runproxy()}
result = requests.get('http://www.yandex.ru', proxies=httproxy)
if status_code == 200:
return httproxy
good_proxy = None
while not good_proxy:
good_proxy = check()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question