14 أسطر
347 B
Python
14 أسطر
347 B
Python
from urllib.request import urlopen
|
|
from urllib.error import HTTPError
|
|
import time
|
|
|
|
|
|
while True:
|
|
try:
|
|
with urlopen('https://node-app-75fbd9c11652.hosted.ghaymah.systems/health') as response:
|
|
print(f"Status Code: {response.status}")
|
|
|
|
except HTTPError as error:
|
|
print(f"Error Status Code: {error.code}")
|
|
time.sleep(30)
|