python requests
-
[Python] website basic monitoring usging requests module (웹 사이트 모니터링)System ManageMent 2018. 5. 5. 16:33
파이썬(python) requests 모듈을 이용한 간단한 웹 사이트 모니터링. import requests import time from datetime import datetime url = ('url1','url2','url3') # tuple while True: for site in url: with requests.Session() as s: r = s.get(site) if r.status_code == 200: # r.status_code : response status print('%s is ok : Response Status : %d' %(site, r.status_code)) else: print('%s is Check : Response Status : %d' % (site, r...