import requests
try:
response = requests.get(‘https://www.example.com’, timeout=5)
except requests.exceptions.Timeout
print(“Request timed out!”)
import requests
try:
response = requests.get(‘https://www.example.com’, timeout=5)
except requests.exceptions.Timeout
print(“Request timed out!”)