We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cfa6ea commit 538b4bcCopy full SHA for 538b4bc
ACedIt/util.py
@@ -379,8 +379,15 @@ def get_html(url):
379
"""
380
Utility function get the html content of an url
381
382
+ MAX_TRIES = 3
383
try:
- r = rq.get(url)
384
+ for try_count in range(MAX_TRIES):
385
+ r = rq.get(url)
386
+ if r.status_code == 200:
387
+ break
388
+ if try_count >= MAX_TRIES:
389
+ print 'Could not fetch content. Please try again.'
390
+ sys.exit(0)
391
except Exception as e:
392
print 'Please check your internet connection and try again.'
393
sys.exit(0)
0 commit comments