Last active
December 18, 2020 17:25
-
-
Save cjpais/5f9ffc5825ab78f19e0b91b673bb7f13 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
import time | |
import random | |
while True: | |
try: | |
response = urllib.request.urlopen('https://apple.com/') | |
html = response.read() | |
except: | |
print("some error but graceful handling (aka ignoring)") | |
dur = random.randint(0,240) | |
print("Goodnight Moon. Sleeping for {}sec".format(dur)) | |
time.sleep(dur) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment