我有这个检查网站的程序,我想知道如何通过Python中的代理检查它...
这是代码,仅举例来说
while True:
try:
h = urllib.urlopen(website)
break
except:
print '['+time.strftime('%Y/%m/%d %H:%M:%S')+'] '+'ERROR. Trying again in a few seconds...'
time.sleep(5)
Run Code Online (Sandbox Code Playgroud)