code-dumps/py/url-check.py

11 lines
300 B
Python
Raw Normal View History

#!/usr/bin/python3
import urllib3
from urllib3 import Timeout
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
http = urllib3.PoolManager(cert_reqs='CERT_NONE')
url = "https://blog.headdesk.me"
r = http.request('GET', url, timeout=Timeout(10))
print("statusCode: %s" % r.status)