code-dumps/py/url-check-urllib3.py
2023-03-29 13:59:25 +08:00

11 lines
299 B
Python
Executable File

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